【问题标题】:Proximo heroku addon timeout on https requestshttps请求上的Proximo heroku插件超时
【发布时间】:2013-04-29 17:34:00
【问题描述】:

我刚刚为 python 应用程序安装了 Proximo heroku 插件。我加载了一个外壳并踢了轮胎,然后点击 HTTP 地址可以工作,但 HTTPS 地址不能。 HTTP 地址显示在 Proximo 日志中,HTTPS 地址超时,不会在日志中留下任何内容。

我使用以下代码进行了测试:

import urllib2, urllib
from django.conf import settings

proxy  = urllib2.ProxyHandler(settings.PROXIES_DICT)
auth   = urllib2.HTTPBasicAuthHandler()
opener = urllib2.build_opener(proxy, auth, urllib2.HTTPHandler)
urllib2.install_opener(opener)

urllib2.urlopen("http://google.com").read()  # works fine
urllib2.urlopen("https://google.com").read() # times out

我应该提到 PROXIES_DICT 看起来像这样(替换密码):

>>> pprint(settings.PROXIES_DICT)
{'http': 'http://proxy:password@proxy-54-235-72-96.proximo.io',
 'https': 'http://proxy:password@proxy-54-235-72-96.proximo.io'}

我还应该提到超时异常如下所示:

URLError: <urlopen error [Errno 60] Operation timed out>

我不确定我做错了什么。有人可以帮忙吗?

【问题讨论】:

    标签: heroku proxy proximo


    【解决方案1】:

    此代码尝试使用 HTTP 连接到 Proximo 代理,但使用的是 443 端口。尝试以下设置:

    {'http': 'http://proxy:password@proxy-54-235-72-96.proximo.io',
     'https': 'http://proxy:password@proxy-54-235-72-96.proximo.io:80'}
    

    您知道 Proximo 不侦听 HTTPS,因此从您的应用程序到代理的连接不会被加密?

    【讨论】:

    • 知道了,谢谢。是的,我知道它不听 https。鉴于代理在我的客户端和服务器之间来回传递的数据仍然是加密的,代理的实际连接不是很好。
    猜你喜欢
    • 1970-01-01
    • 2020-06-20
    • 1970-01-01
    • 2011-11-27
    • 1970-01-01
    • 2015-12-19
    • 1970-01-01
    • 1970-01-01
    • 2013-02-21
    相关资源
    最近更新 更多