• Mac 下安装mitmproxy


    环境:  Mac OS X 10.9.4

    1. 安装

    直接用pip 安装

    pip install mitmproxy

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

    In file included from src/lxml/lxml.etree.c:239:
    
    /private/tmp/pip_build_root/lxml/src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found
    
    #include "libxml/xmlversion.h"
    
             ^
    
    1 error generated.
    
    error: command 'cc' failed with exit status 1

    参考网上解决办法 

    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.10.sdk/usr/include/libxml2/libxml/xmlversion.h
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.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.9.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 ,成功

  • 相关阅读:
    常用软件的安装(windows/linux)
    常用软件的安装(windows/linux)
    图像块的访问(填充 padding,步长 stride,窗 Window/kernel/filter)
    hdu4620 Fruit Ninja Extreme
    java中的object类
    [置顶] android 自定义TextView
    [置顶] think in java interview-高级开发人员面试宝典(八)
    POJ 2112 Optimal Milking (二分+最短路径+网络流)
    BitHacks--位操作技巧
    hdu 4614 Vases and Flowers (二分 线段树)
  • 原文地址:https://www.cnblogs.com/balaamwe/p/4185628.html
Copyright © 2020-2023  润新知