Using telnet to Simulate a HTTP Client: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 27: Line 27:
</pre>
</pre>


httpd will react to that if [[Httpd_KeepAlive#KeepAlive|KeepAlive]] is "On", and will keep the connection alive for KeepAliveTimeout seconds.
httpd will react to that if [[Httpd_KeepAlive#KeepAlive|KeepAlive]] is "On", and will keep the connection alive for [[Httpd_KeepAliveTimeout#KeepAliveTimeout|KeepAliveTimeout]] seconds.

Revision as of 23:17, 8 January 2017

Internal

Overview

To close connection immediately:

telnet localhost 10000
GET /index.html HTTP/1.1
Host: localhost:10000
Connection: close

HTTP/1.1 200 OK
Content-Length: 37
Server: NovaOrdis http-server
Connection: close
...
Connection closed by foreign host.

To keep the connection alive (with httpd as proxy), use

Connection: Keep-Alive

httpd will react to that if KeepAlive is "On", and will keep the connection alive for KeepAliveTimeout seconds.