When does an HTTP 1.0 server close the connection?

前端 未结 1 757
情深已故
情深已故 2021-01-02 15:38

Background: I am trying to get ApacheBench working on my custom server. I tried issuing ab -n 1 -c 1 http://localhost:1337/index.html and I sniffing the connect

相关标签:
1条回答
  • 2021-01-02 16:07

    In HTTP 0.9, the server always closes the connection after sending the response. The client must close its end of the connection after receiving the response.

    In HTTP 1.0, the server always closes the connection after sending the response UNLESS the client sent a Connection: keep-alive request header and the server sent a Connection: keep-alive response header. If no such response header exists, the client must close its end of the connection after receiving the response.

    In HTTP 1.1, the server does not close the connection after sending the response UNLESS the client sent a Connection: close request header, or the server sent a Connection: close response header. If such a response header exists, the client must close its end of the connection after receiving the response.

    0 讨论(0)
提交回复
热议问题