-
Notifications
You must be signed in to change notification settings - Fork 597
How to use different ExternalProxy for each https request ? #313
Comments
We don't yet support each HTTP request from a single client TCP connection to use different external proxy. However we do support changing external stream proxy on a per connection basis. That's why you see the call is getting hit only once at the beginning of connection establishment to server and not for subsequent HTTP requests over same TCP connection from client. The reason we haven't given much interest to do the same have to do with performance. You may be aware that typically a series of HTTP request/response sequence is done over a TCP connection from client to proxy and then from proxy to external proxy. If you keep changing the external proxy for each HTTP request from same client connection then the proxy would have to each time drop existing TCP connection to server and create new one. This will greatly affect performance, defeating the purpose of HTTP 1.1 keep-alive feature. Ideally a single connection from client should be piped to a single connection to same up stream proxy for HTTP keep-alive functionality to accomplish its purpose. Having said that a way to mitigate the overhead would be to use a TCP connection cache in proxy. I think one day when we implement the cache we would support this feature. Implementation of a connection cache is not trivial since we need to make sure that the connection is in valid TCP state in cache and matches exactly the same end point, external proxy and any other things that identify a unique connection. |
Meanwhile if any one is interested in doing a short term solution to this by dropping and creating server connection when external proxy changes this is up for grab. That would mean calling GetCustomHttp(s)ProxyFunc methods for each request. |
Great, Thanks your guide. I try to modify this. |
No, they are set when the server connection is created. |
The link is broken :( (404) |
See #512 |
I close this issue due to inactivity. Feel free to reopen if needed. |
all links leading to the actual piece of code dead once again |
Ok, but if you are a developer, it should not be hard to find a class in the repository at the given date...
And the latest version: titanium-web-proxy/src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs Lines 111 to 135 in 1236dce
|
In my test, when the first https request had responsed, the second request doesn't call ProxyServer.GetExternalProxyFunc.
I had try the following code, but not work:
The text was updated successfully, but these errors were encountered: