Skip to content
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

Proxy & Keep-Alive cache #20

Open
seriyps opened this issue Oct 13, 2012 · 0 comments
Open

Proxy & Keep-Alive cache #20

seriyps opened this issue Oct 13, 2012 · 0 comments

Comments

@seriyps
Copy link

seriyps commented Oct 13, 2012

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:

  1. client connects to server {Host, Port, Ssl}
  2. server returns response and keep connection alive
  3. lhttpc keep open socket on lhttpc_manager under {Host, Port, Ssl} key
  4. 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:

  1. client connects to sever {Host, Port, Ssl} through proxy-server {PHost, PPort, PSsl}, by specifying proxy option
  2. server returns response and may keep connection alive; proxy keep connection with client alive
  3. lhttpc keep open socket (connected to proxy-server {PHost, PPort, PSsl}) under key {Host, Port, Ssl} !!!
  4. 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}

g-andrade added a commit to g-andrade/lhttpc that referenced this issue Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant