Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Adds the option to omit the usage of a CONNECT tunnel by adding the noconnect parameter to the URL of the proxy.

duendex23c3288a6d07
diff --git a/scrapy/core/downloader/handlers/http11.py b/scrapy/core/downloader/handlers/http11.py
index 0187b6f3c..1985e1251 100644
--- a/scrapy/core/downloader/handlers/http11.py
+++ b/scrapy/core/downloader/handlers/http11.py
@@ -138,9 +138,10 @@ class ScrapyAgent(object):
bindaddress = request.meta.get('bindaddress') or self._bindAddress
proxy = request.meta.get('proxy')
if proxy:
- _, _, proxyHost, proxyPort, _ = _parse(proxy)
+ _, _, proxyHost, proxyPort, proxyParams = _parse(proxy)
scheme = _parse(request.url)[0]
- if scheme == 'https':
+ skipConnectTunnel = proxyParams.find('noconnect') >= 0
+ if scheme == 'https' and not skipConnectTunnel:
proxyConf = (proxyHost, proxyPort,
request.headers.get('Proxy-Authorization', None))
return self._TunnelingAgent(reactor, proxyConf,