V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2018-09-21 23:21:19 +08:00 · 1145 次点击
    这是一个创建于 2014 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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 条回复    2018-09-23 12:34:18 +08:00
    Septembers
        1
    Septembers  
       2018-09-22 01:44:09 +08:00 via Android
    socks 是什么库?
    你自己审计过源码吗?
    t333st
        2
    t333st  
    OP
       2018-09-22 13:08:01 +08:00
    @Septembers 使用一个库就要阅读审计一个库的源码?
    lolizeppelin
        3
    lolizeppelin  
       2018-09-23 12:34:18 +08:00 via Android
    难道你们都不看源码的 23333
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5459 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 09:07 · PVG 17:07 · LAX 02:07 · JFK 05:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.