Add schemaless http proxy support

This commit is contained in:
ajaymittur28 2020-06-27 20:36:45 +05:30
parent 0c8d8c5e85
commit 23da8e1068
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ import warnings
from contextlib import suppress
from io import BytesIO
from time import time
from urllib.parse import urldefrag
from urllib.parse import urldefrag, urlparse
from twisted.internet import defer, protocol, ssl
from twisted.internet.endpoints import TCP4ClientEndpoint
@ -255,7 +255,7 @@ class ScrapyProxyAgent(Agent):
bindAddress=bindAddress,
pool=pool,
)
self._proxyURI = URI.fromBytes(proxyURI)
self._proxyURI = URI.fromBytes(urlparse(proxyURI)._replace(scheme=b'http').geturl())
def request(self, method, uri, headers=None, bodyProducer=None):
"""