You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HTTP/1.1 defines the "close" connection option for the sender to signal that the connection will be closed after completion of the response. For example,
Connection: close
in either the request or the response header fields indicates that the connection SHOULD NOT be considered `persistent' (section 8.1) after the current request/response is complete.
HTTP/1.1 applications that do not support persistent connections MUST include the "close" connection option in every message.
* Connected to localhost (::1) port 8090 (#0)
* Connection #0 to host localhost left intact
* Re-using existing connection! (#0) with host localhost
* Connected to localhost (::1) port 8090 (#0)
* Connection #0 to host localhost left intact
Recommendation
* Allow keepAlive always and remove Server.keepAlive
* The user requests can use "Connection: close" in the request header to control re-use mechanism
* Also may be we can explore keepAliveTimeout mechanism rather, if there is a substantial use case.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
There are two standard ways of verifying KeepAlive feature:
Keep Alive Test case 1
https://serverfault.com/a/554668
Getting "left intact" message while using curl
Keep Alive Test case 2
As per RFC https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.10
Current behavior in zio-Http
We intend to enable / disable "keep alive" using
Scenario 1. Explicitly enabling Server.keepAlive while creating Server
For Http 1.0
We get connection: close in response header (correct behavior) indicating no re-use
For Http 1.1 (Without Connection: close in request header)
We get "left intact" message indicating re-use (correct behaviour)
For Http 1.1 (WITH Connection: close in request header)
We get Connection: close in response header indicating no re-use (correct behaviour)
Scenario 2. Disabled Server.keepAlive while creating Server
The "proof" that keepAlive is still working even if we don't use Server.keepAlive
Run HelloWorldAdvanced in examples test (with Server.keepAlive disabled), and fire these curl requests from command line
We see the message regarding Re-use
Recommendation
Beta Was this translation helpful? Give feedback.
All reactions