推荐学习书目
› 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
lanqing
V2EX  ›  Python

如何实现网络请求转发

  •  
  •   lanqing · Nov 29, 2018 · 3907 views
    This topic created in 2868 days ago, the information mentioned may be changed or developed.

    具体需求如下:

    1. 1 个服务器,多个客户端, 当服务器接受一个网络请求(如访问百度首页),将这个请求转发给某个客户端,客户端将请求的结果返回给服务器
    2. 要求百度看到的请求是来自于客户端的(特指 ip)

    因为对网络这一块的知识了解的不多,不知需要哪些技术可以支持这个需求(有没有轮子可以用),请赐教= =

    8 replies  •  2018-11-29 17:45:38 +08:00
    Aliencn
        1
    Aliencn  
       Nov 29, 2018
    1.DNS 做域名劫持,Nginx 做代理。
    2.百度看到是代理服务器的地址。
    jimzhong
        2
    jimzhong  
       Nov 29, 2018
    LZ 可以看一下这三个工具:
    socat
    haproxy
    squid
    SummerWQM
        3
    SummerWQM  
       Nov 29, 2018
    先说清楚 你是要转发哪一层
    jitongxi
        4
    jitongxi  
       Nov 29, 2018
    我仿佛闻到了了黑产的味道.....

    这种东西一般黑产自己开发的,因为能有这种需求的一般都见不得光。
    nekoneko
        5
    nekoneko  
       Nov 29, 2018
    spring 就可以了啊,服务端 controller 接收请求,restTemplate 封装,发送到客户端 controller,客户端封装后请求真实服务器,返回结果返回给服务端,服务端再返回给客户端。
    miniliuke
        6
    miniliuke  
       Nov 29, 2018 via Android
    这不就是代理吗?^O^轮子的话随便找个代理软件就行了.......甚至有专门卖代理池的,都不需要你搭客户端
    t6attack
        7
    t6attack  
       Nov 29, 2018
    又可以解释“为什么浏览器要限制跨域请求”了。如果没有跨域限制,网站可以把在线访客当成代理资源使用。就像楼主这种需求,一个 web 页面就能实现。那样互联网就乱套了。
    305835227fadf
        8
    305835227fadf  
       Nov 29, 2018
    你想干什么坏事,哈哈!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2450 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 05:48 · PVG 13:48 · LAX 22:48 · JFK 01:48
    ♥ Do have faith in what you're doing.