First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

can a proxy use a single tcp connection to a remote website for many different client connections (serialize several client requests into one outgoing request)?

my understanding was that proxies create a new TCP connection to a remote website for every client connection. Recently I got a tcpdump (sorry, cannot share it here) with a single TCP connection between the proxy and a remote website and several GET requests from two different users (both User-Agents and cookies are different). Can this behaviour confuse the web server? Does a server require X-Forwarded-For or similar header to disqungish such requests?

here is a "follow tcp stream" output excerpt:

GET /a HTTP/1.1
Cookie: JSESSIONID=123
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
Host: example.com
Via: proxy1
Cache-Control: max-age=0, max-stale=0
Connection: keep-alive

HTTP/1.1 304 Not Modified
Date: Tue, 10 Dec 2018 01:01:01 GMT
Content-Type: text/plain;charset=utf-8
Cache-Control: no-cache
Pragma: no-cache


GET /b HTTP/1.1
Cookie: JSESSIONID=456
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/533.11 (KHTML, like Gecko) Chrome/81.0.2.3 Safari/533.11
Host: example.com
Via: proxy1
Cache-Control: max-age=20000, max-stale=0
Connection: keep-alive

HTTP/1.1 304 Not Modified
Date: Tue, 10 Dec 2018 01:01:01 GMT
kaos's avatar
13
kaos
asked 2020-12-12 01:20:42 +0000, updated 2020-12-12 01:39:33 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

Yes, Web-proxies can be configured to optimize by multiplexing client requests over existing serverside requests. On the webserver-side you need to take this into account. You should handle each request on it's own and not each TCP connection. So if there is a stateful session, use session cookies to distinguish requests from different users.

SYN-bit's avatar
18.5k
SYN-bit
answered 2020-12-12 11:57:57 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer