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
iiusky
V2EX  ›  Python

如何用 Python 搞一个代理服务器

  •  
  •   iiusky · 2017-03-24 19:40:15 +08:00 · 6695 次点击
    这是一个创建于 2588 天前的主题,其中的信息可能已经有所发展或是发生改变。

    想做一个中转代理服务器,用 python 写,在浏览器上设置代理 ip : port ,然后把所有的 http 和 https 的包都进行转发,同时做一些不可描述的事情,如何搞呢?

    12 条回复    2017-03-28 23:01:32 +08:00
    LokiSharp
        1
    LokiSharp  
       2017-03-24 19:46:19 +08:00 via iPhone
    看看 SS 的源码不就知道了。。。
    wangxn
        2
    wangxn  
       2017-03-24 20:39:51 +08:00 via Android
    容易,一搜就有教程。
    est
        3
    est  
       2017-03-24 21:05:25 +08:00   ❤️ 1
    当年有个人也是这样想的,然后就照着网上的 socks5 教程做了个 ss
    000wangxinyu000
        4
    000wangxinyu000  
       2017-03-24 21:15:03 +08:00
    接楼上~后来那个人被叫去喝茶了
    lixingcong
        5
    lixingcong  
       2017-03-24 21:34:22 +08:00 via Android
    故事继续发展。。 c 大去了美国
    findex
        6
    findex  
       2017-03-24 21:48:30 +08:00
    @lixingcong 你确定是肉翻了吗?
    zk8802
        7
    zk8802  
       2017-03-24 23:27:57 +08:00
    楼主可以参考 https://github.com/inaz2/proxy2
    lixingcong
        8
    lixingcong  
       2017-03-25 00:00:24 +08:00 via Android
    @findex 不清楚是不是肉番,推特上看到有人说的
    icedx
        9
    icedx  
       2017-03-25 00:13:33 +08:00
    看你的描述 你应该是从零开始的

    不过我推荐你最好不要开始

    人生多美好啊 何必去浪费时间
    iiusky
        10
    iiusky  
    OP
       2017-03-25 09:52:59 +08:00
    @LokiSharp 嗯好
    @wangxn
    @est -,-
    @000wangxinyu000 @lixingcong @findex 发展成故事会了?
    @zk8802 非常感谢

    @icedx 2333
    claysec
        11
    claysec  
       2017-03-25 12:44:14 +08:00
    肉翻是最好的方法
    gwind
        12
    gwind  
       2017-03-28 23:01:32 +08:00
    我们一开始用 Python 开发消息系统,后来改用 golang 。
    其实现在很多 tunnel 都是用 golang 开发的,如果愿意学习,推荐看看:
    1. https://github.com/getqujing/qtunnel (几百行代码,单向代理隧道,合适你的需求 , TCP 协议都支持)
    2. https://github.com/ooclab/es (我们写的,从 Python 发展而来, 4000 行左右代码,双向对称设计)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1055 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:26 · PVG 06:26 · LAX 15:26 · JFK 18:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.