Problem when the host is changed
Hey, When using the proxy, I've noticed that redirects to different hosts are redirected to the original host. It looks like the connection is reused even if the target host is changed. I've managed to implement a workaround with setting the Connection header to 'Close' in BeforeResponse so the connection would not be reused, but it looks like a bug in the code.
Are you making request from a Browser? I am not sure if this is a standard behavior in HTTP protocol.
Currently we don't expect a single connection from client to change host-names, proxy will reuse the same connection to server (from IP of first client request host name) until the end of client connection. If client wants to connect to another host name it should create another connection to the new host via the proxy.
Having said the if different host names on subsequent requests all point to same server it shouldn't be a problem, since we already have a connection to the same server.
I'm using the proxy with a selenium web driver, which is a browser used from code. When a site redirects to a different one the call is still persisted to the original site, even though the target server is a different one. Maybe a check for the host header could be enough to ensure that the connection can be reused.
We can update the behavior on Proxy to drop the current server connection and create a new server connection when host name changes without dropping the client connection.
I'm less familiar with these topics, that's why I open and issue instead of submitting a merge request. It sounds like is should work...
Should be fixed in latest develop