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

请问大家 Python 应用如何通过代理服务器访问多个外网服务器啊?

  •  
  •   Gerry123 · 178 天前 · 1087 次点击
    这是一个创建于 178 天前的主题,其中的信息可能已经有所发展或是发生改变。

    因为业务需要,公司内部服务 python 应用需要访问到远程的数据库,数据库有多个,都分布在外网,python 应用不能直接访问这些外网数据库,中间需要有个代理,这个代理服务器到这些外网服务器网络是通的,python 应用到这个代理服务器的网络也是通的(已开墙),请问大家 python 应用如何通过这个代理服务器访问多个外网服务器啊?

    4 条回复    2023-11-02 18:22:38 +08:00
    chiron688
        1
    chiron688  
       178 天前
    ssh 隧道啊 sshtunnel 这个包你可以了解一下.....或者外网服务器开 socks5 代理,不过感觉最好的,还是在代理服务器上做个 ipt 转发,转发数据库的端口之类的,一个数据库对应一个端口,要用哪个就改成哪个端口
    initObject
        2
    initObject  
       178 天前 via Android
    代理服务器用 Haproxy 或者 nginx 做四层反代即可
    Gerry123
        3
    Gerry123  
    OP
       177 天前
    @chiron688 谢谢,我用了 socks5 代理,在代理服务器上安装了 dante
    Gerry123
        4
    Gerry123  
    OP
       177 天前
    @initObject 谢谢,我用了 socks5 代理,在代理服务器上安装了 dante
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1418 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:19 · PVG 01:19 · LAX 10:19 · JFK 13:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.