推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
t333st
V2EX  ›  Python

请教下大佬们关于 socks.wrapmodule 的问题

  •  
  •   t333st · Sep 21, 2018 · 2017 views
    This topic created in 2803 days ago, the information mentioned may be changed or developed.
    def btest():
        socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, '58.243.107.xx', 4365)
        socks.wrapmodule(smtplib)
        burl = 'http://www.ip138.com/ips1388.asp'
        resp1 = requests.get(burl).text
        print(resp1)
    

    代码如上,resp1 的结果 ip 是'58.243.107.xx'
    为何在使用 socks.wrapmodule(smtplib)后会影响 requests 的使用
    或者说,有办法避免或解决这个 bug 的好方案吗?
    菜鸟一枚,各位轻虐

    3 replies    2018-09-23 12:34:18 +08:00
    Septembers
        1
    Septembers  
       Sep 22, 2018 via Android
    socks 是什么库?
    你自己审计过源码吗?
    t333st
        2
    t333st  
    OP
       Sep 22, 2018
    @Septembers 使用一个库就要阅读审计一个库的源码?
    lolizeppelin
        3
    lolizeppelin  
       Sep 23, 2018 via Android
    难道你们都不看源码的 23333
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5996 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 466ea39e · 70ms · UTC 02:56 · PVG 10:56 · LAX 19:56 · JFK 22:56
    ♥ Do have faith in what you're doing.