环境:  Mac OS X 10.9.4

1. 安装

直接用pip 安装

pip install mitmproxy

发现在安装依赖包 lxml 的时候报错

In file included from src/lxml/lxml.etree.c::

/private/tmp/pip_build_root/lxml/src/lxml/includes/etree_defs.h::: fatal error: 'libxml/xmlversion.h' file not found

#include "libxml/xmlversion.h"

         ^

 error generated.

error: command 'cc' failed with exit status 

参考网上解决办法

launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
sh-3.2# locate xmlversion.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10..sdk/usr/include/libxml2/libxml/xmlversion.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10..sdk/usr/include/libxml2/libxml/xmlversion.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/xmlversion.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/libxml2/libxml/xmlversion.h
ln -s /usr/include/libxml2 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10..sdk/usr/include/libxml2/libxml

重新编译,发现还是不行

执行如下命令

xcode-select --install

可以正常安装了

2. 使用

安装完毕后,会在 /usr/local/bin 目录下生成 mitmproxy mitmdump 2个命令

尝试执行下

sh-3.2# /usr/local/bin/mitmproxy
You are using an outdated version of pyOpenSSL: mitmproxy requires pyOpenSSL 0.14 or greater.
Your pyOpenSSL 0.13 installation is located at /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/OpenSSL

发现 pyOpenSSL 0.14 版本

上pypi.python.org 找下 ,下载源码并安装

wget https://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.14.tar.gz#md5=8579ff3a1d858858acfba5f046a4ddf7
tar zxvf pyOpenSSL-0.14.tar.gz
cd pyOpenSSL-0.14
python setup.py install

在执行下 /usr/local/bin/mitmproxy ,成功

Mac 下安装mitmproxy的更多相关文章

  1. Mac 下安装Jenkins

    Mac 下安装Jenkins 开始 Jenkins是一个基于Java开发的一种持续集成工具,用于建工持续重复的工作,功能包括: 持续的软件版本发布/测试项目 监控外部调用执行的工作. 近期打算搭建自动 ...

  2. MAC下安装与配置MySQL

    MAC下安装与配置MySQL   MAC下安装与配置MySQL 一 下载MySQL 访问MySQL的官网http://www.mysql.com/downloads/ 然后在页面中会看到“MySQL ...

  3. Mac下安装UPnP Inspector

    由于工作中需要用到UPnP Inspector这个工具,而这个工具在windows下安装非常简单,在Mac下安装却很麻烦,在此记录安装流程. 这个工具依赖于两个其他的库:Coherence(一个DLN ...

  4. Mac下安装Wireshark,双击闪退

     Mac OS X上使用Wireshark抓包(http://blog.csdn.net/phunxm/article/details/38590561) Mac下安装Wireshark /Appli ...

  5. Mac下安装zshell

    Mac 下安装zshell 什么是shell 大多数命令行用户接触最多的是Bash,因为Bash是各个版本操作系统(Linux&Mac)的默认shell. 查看当前使用的shell $ ech ...

  6. 【高可用HA】Apache (1) —— Mac下安装Apache Httpd到自定义路径(非/etc/apache2)

    Mac下安装Apache Httpd httpd版本: httpd-2.4.17 参考来源: Tomcat Clustering - A Step By Step Guide Apache HTTP ...

  7. 《OD大数据实战》mac下安装nginx+php

    一.mac安装nginx + php + php-fpm  或apache + php 1. Mac 下 Nginx.MySQL.PHP-FPM 的安装配置 2. Mac下安装LNMP(Nginx+P ...

  8. Mac下安装HBase及详解

    Mac下安装HBase及详解 1. 千篇一律的HBase简介 HBase是Hadoop的数据库, 而Hive数据库的管理工具, HBase具有分布式, 可扩展及面向列存储的特点(基于谷歌BigTabl ...

  9. 在mac下安装jdk1.7(转)

    转自:http://vela.diandian.com/post/2012-01-06/15379924 最近呢,想玩玩jdk1.7,不过mac平台下的jvm一直都是Apple自己改的,所有有些麻烦. ...

随机推荐

  1. poj 1035 Spell checker

    Spell checker Time Limit: 2000 MS Memory Limit: 65536 KB 64-bit integer IO format: %I64d , %I64u   J ...

  2. 笔记:Hyper-V上Centos 6.5分辨率调整问题解决笔记

    最近忙的没有心情写东西,果然博客就这么长草了.今天就稍微写一点点东西吧,反正这问题挺烦的. 背景如下:为准备做redis集群实验,特在笔记本上搭建CentOS6.5的Hyper-V虚拟机. 虚拟机创建 ...

  3. unity3D——自带寻路Navmesh入门教程(二)(转)

    转自:http://liweizhaolili.blog.163.com/blog/static/16230744201271210237616/ 上一节简单介绍了NavMesh寻路的基本用法,这次来 ...

  4. [游戏模版17] Win32 推箱子 迷宫

    >_<:Here introduce a simple game: >_<:resource >_<:only can push a box and finally ...

  5. SharePoint 2013 REST 以及 OData 基础

    这篇文章会介绍: 简单的介绍REST,OData OData实现细节 OData在SharePoint 2013中的实现 为什么REST很重要 过去几年基于REST的webservice在IT企业越来 ...

  6. SpringMVC文件上传实现

    SpringMVC(注解)上传文件需要注意的几个地方:1.form的enctype="multipart/form-data",这个是上传文件必须的2.applicationCon ...

  7. C/C++文件操作2

    一.流式文件操作 这种方式的文件操作有一个重要的结构FILE,FILE在stdio.h中定义如下: typedef struct { int level; /* fill/empty level of ...

  8. IOS设计模式浅析之简单工厂模式(SimpleFactory)

    概述 首先说明一下,简单工厂模式不属于23种GOF设计模式之一.它也称作静态工厂方法模式,是工厂方法模式的特殊实现.这里对简单工厂模式进行介绍,是为本系列后面的工厂方法和抽象工厂模式做一个引子. 定义 ...

  9. 如何保证access_token长期有效

    为了使第三方开发者能够为用户提供更多更有价值的个性化服务,微信公众平台开放了许多接口,包括自定义菜单接口.客服接口.获取用户信息接口.用户分组接口.群发接口等,开发者在调用这些接口时,都需要传入一个相 ...

  10. C# 标签(条码)的打印与设计(一)

    C# 标签(条码)的打印与设计(一) C# 标签(条码)的打印与设计(二) 总结:自定义设计条码器.