Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch HTTP server to HTTP 1.1 #395

Merged
merged 4 commits into from
Aug 27, 2022
Merged

Switch HTTP server to HTTP 1.1 #395

merged 4 commits into from
Aug 27, 2022

Conversation

vinc
Copy link
Owner

@vinc vinc commented Aug 25, 2022

  • Respond with HTTP/1.1 instead of HTTP/1.0
  • Respond with Connection: keep-alive instead of Connection: close
  • Add packet capture to QEMU

https://www.rfc-editor.org/rfc/rfc2616#page-44

@vinc
Copy link
Owner Author

vinc commented Aug 25, 2022

Testing HTTP keep-alive:

$ curl -v -L http://localhost:8080/tmp
*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /tmp HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.84.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 301 Moved Permanently
< Connection: keep-alive
< Content-Length: 28
< Content-Type: text/html; charset=utf-8
< Date: Thu, 25 Aug 2022 18:53:21 GMT
< Location: /tmp/
< Server: MOROS/0.8.0
<
* Ignoring the response-body
* Connection #0 to host localhost left intact
* Issue another request to this URL: 'http://localhost:8080/tmp/'
* Found bundle for host: 0x557f72d24af0 [serially]
* Can not multiplex, even if we wanted to
* Re-using existing connection #0 with host localhost
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /tmp/ HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.84.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Connection: keep-alive
< Content-Length: 251
< Content-Type: text/html; charset=utf-8
< Date: Thu, 25 Aug 2022 18:53:21 GMT
< Server: MOROS/0.8.0
<
<h1>Index of /tmp/</h1>
<li><a href="/tmp/alice.txt">alice.txt</a></li>
<li><a href="/tmp/beep">beep</a></li>
<li><a href="/tmp/hello.txt">hello.txt</a></li>
<li><a href="/tmp/lisp">lisp</a></li>
<li><a href="/tmp/machines.txt">machines.txt</a></li>
* Connection #0 to host localhost left intact

@vinc vinc marked this pull request as ready for review August 27, 2022 10:36
@vinc vinc merged commit 7f3baa2 into trunk Aug 27, 2022
@vinc vinc deleted the feature/httpd-1.1 branch November 13, 2022 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant