chore: align with trusttunnel's official session reuse logic#2683
Conversation
Build CONNECT requests against the proxy server while keeping the destination host in the Host header. This lets trusttunnel reuse upstream sessions by proxy authority instead of opening separate HTTP/2 or HTTP/3 connections for each destination host.
|
Your second commit is unnecessary. http2Transport will automatically reconnect after an error. Please restore the content to the first commit. |
5af48c6 to
d8d701c
Compare
Ok, done. But what's the point of health-check then? Maybe rename it to 'keep-alive' ? |
That name was simply to follow the naming conventions of the original TrustTunnel. |
|
In addition, please add comments to the two |
|
I'm wondering if the default values in our PoolClient should be modified accordingly after this change. Because previously, different TCP targets would actually trigger new underlying connections, but this PR changes that behavior. |
you mean max-connections and etc.? The official TrustTunnel client has max 8 connections and 5 streams before opening new connection by default, so we can use this values |
|
It seems we should change the default values to: max-connections: 8
min-streams: 5Please modify the default values in NewPoolClient and docs/config.yaml. |
Build CONNECT requests against the proxy server while keeping the target host in the Host header.
This lets us pool sessions by the actual upstream proxy authority instead of opening separate connections for each destination host so the "max-connections" setting works as expected.