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

怎么判断一个代理 ip 支持哪种协议?

  •  
  •   kidlfy · 2019-05-14 15:40:07 +08:00 · 2295 次点击
    这是一个创建于 1802 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如题 现在一般请求一个 http 的网址也会自动跳转到 https 如百度,想知道怎么才能判断一个 ip 是否支持 http/https

    7 条回复    2019-05-14 19:57:51 +08:00
    goreliu
        1
    goreliu  
       2019-05-14 15:42:49 +08:00 via iPhone
    使用代理访问一个 https 地址试试。
    kidlfy
        2
    kidlfy  
    OP
       2019-05-14 15:48:30 +08:00
    @goreliu https 的可以主要是 http 的
    goreliu
        3
    goreliu  
       2019-05-14 15:51:20 +08:00 via iPhone
    @kidlfy 一样的。不尝试一次就不清楚代理能不能用,比如有的代理不管访问什么网址都会返回同一个页面。除了访问一次加验证返回内容,没有更容易的判断方法。
    jinliming2
        4
    jinliming2  
       2019-05-14 16:14:24 +08:00 via iPhone
    只能去尝试连接,拿 TCP 请求一下 80 443 端口,但是 TCP 通了也不一定就是标准的 HTTP HTTPS。
    c4f36e5766583218
        5
    c4f36e5766583218  
       2019-05-14 16:55:44 +08:00
    dsg001
        6
    dsg001  
       2019-05-14 18:26:56 +08:00
    现在用 https://httpbin.org/get 做代理验证
    yingfengi
        7
    yingfengi  
       2019-05-14 19:57:51 +08:00 via Android
    如果我开了个 http 服务在 2333 端口呢?
    没那么容易。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5246 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 07:45 · PVG 15:45 · LAX 00:45 · JFK 03:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.