This is not a issue, but discussion.
lhttpc_client.erl uses {Host, Port, Ssl} tuple for lookup keep-alive sockets in lhttpc_manager.erl
So:
- client connects to server {Host, Port, Ssl}
- server returns response and keep connection alive
- lhttpc keep open socket on lhttpc_manager under {Host, Port, Ssl} key
- client makes one more request to that host {Host, Port, Ssl} and can reuse this socket
But in case when proxy enabled, there is one more component that involved in the process:
- client connects to sever {Host, Port, Ssl} through proxy-server {PHost, PPort, PSsl}, by specifying
proxy option
- server returns response and may keep connection alive; proxy keep connection with client alive
- lhttpc keep open socket (connected to proxy-server {PHost, PPort, PSsl}) under key {Host, Port, Ssl} !!!
- client makes one more connection to that host {Host, Port, Ssl}, but provide OTHER
proxy option. But lhttpc_manager return cached connection to proxy-server {PHost, PPort, PSsl}
My suggestion: include proxy option in the cache key, eg host {Host, Port, Ssl, ProxyUrl}
This is not a issue, but discussion.
lhttpc_client.erluses{Host, Port, Ssl}tuple for lookup keep-alive sockets inlhttpc_manager.erlSo:
But in case when proxy enabled, there is one more component that involved in the process:
proxyoptionproxyoption. Butlhttpc_managerreturn cached connection to proxy-server {PHost, PPort, PSsl}My suggestion: include
proxyoption in the cache key, eg host {Host, Port, Ssl, ProxyUrl}