Skip to content

HTTP requests in keepalive session #563

Description

@onyn

Tinyproxy version

1.11.2

Issue

My service call http (without TLS) url via tinyproxy instance and send several requests via single TCP connection.

Here is dump of TCP session from my service to tinyproxy:

* TCP connection to proxy-svc-18.service.lan:80 established

< POST http://1.2.3.4:8080/webhook HTTP/1.1
< Content-Length: 121
< Host: 1.2.3.4:8080
< Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
< Content-Type: application/x-www-form-urlencoded
< User-Agent: WebhookSender/1.7.2
<
< post payload

> HTTP/1.1 200 OK
> Date: Sat, 30 Nov 2024 10:08:12 GMT
> Server: nginx
> Content-Length: 0
> Content-Type: text/html; charset=UTF-8

< POST http://1.2.3.4:8080/webhook HTTP/1.1
< Content-Length: 176
< Host: 1.2.3.4:8080
< Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
< Content-Type: application/x-www-form-urlencoded
< User-Agent: WebhookSender/1.7.2
< 
< post payload 2

* No HTTP response on second request.
* TCP connection closed from remote site

Here is dump of TCP session from tinyproxy to remote destination:

* TCP connection to 1.2.3.4:8080 established

< POST /webhook HTTP/1.1
< Host: 1.2.3.4:8080
< Connection: close
< Content-Length: 121
< Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
< Content-Type: application/x-www-form-urlencoded
< User-Agent: WebhookSender/1.7.2
<
< post payload

> HTTP/1.1 200 OK
> Date: Sat, 30 Nov 2024 10:08:12 GMT
> Server: nginx
> Content-Length: 0
> Connection: close
> Content-Type: text/html; charset=UTF-8

< POST http://1.2.3.4:8080/webhook HTTP/1.1
< Content-Length: 176
< Host: 1.2.3.4:8080
< Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
< Content-Type: application/x-www-form-urlencoded
< User-Agent: WebhookSender/1.7.2
< 
< post payload 2

* No HTTP response on second request.
* TCP connection closed from remote site.

Several questions here:

  1. Why tinyproxy adds Connection: close header?
  2. Why tinyproxy forward response from remote endpoint to my service with Connection: close stripped?
  3. Why tinyproxy ignores its own Connection: close directive and doesn't close any connection?
  4. Why tinyproxy send first request correctly, but second request send to remote endpoint as it received from my service: POST http://1.2.3.4:8080/webhook HTTP/1.1?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions