-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ProxyConnector doesn't always set correct request line #368
Labels
Comments
Hmm. Would you try |
Seems to work... using a request session like this:
|
asvetlov
added a commit
that referenced
this issue
May 18, 2015
…g from now #368 Add connector.force_close property
Fixed in 792b980 -- |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I tried using aiohttp with a HTTP proxy and ran into several problems. Most proxies simply broke and told me the client made a malformed request, some other notified me that I need to enable transparent proxy support.
I think this is because the correct request line is only set when the first connection to the proxy is made.
The relevant code to update the request line for the proxy should be here: https://github.com/KeepSafe/aiohttp/blob/master/aiohttp/connector.py#L523
_create_connection
seems to be called inBaseConnector.connect
, which is only used inClientSession.request
, if I understand the code correctly.If you look at the source of
BaseConnector.connect
you can see that_create_connection
is only called as long as there is no existing connection - thus request that reuse an existing connection don't get an updated request line and will fail, as long as the HTTP proxy doesn't have transparent proxy support.This also happens when reusing the same ProxyConnector for multiple requests, even if not using a Session object, since the connection to the proxy is stored in the Connector.
The text was updated successfully, but these errors were encountered: