[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] Connection: Upgrade / WebSockets
From: |
Christian Grothoff |
Subject: |
[libmicrohttpd] Connection: Upgrade / WebSockets |
Date: |
Sun, 4 Sep 2016 18:14:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.1.0 |
Dear all,
I've just completed adding support for "Connection: Upgrade" to
libmicrohttpd. With this addition, it should be possible to support
WebSockets, upgrade to TLS and all kinds of other protocol switches (via
HTTP response code 101).
To use the new functionality, the application basically queues a special
response (MHD_create_response_for_upgrade) and is in return given a
socket that it can use for bidirectional communication with the client.
There are testcases in src/daemon/test_upgrade(_ssl).c that show how to
use the new API; the texinfo manual has also been updated.
The new API should work the same way *also* for TLS connections, thanks
to some socketpair-magic hiding the change from the application.
While I've tested the code, I don't _actually_ have a need for it
myself: various people on the list simply had requested support for
"Connection: Upgrade" or WebSockets. As a result, I'm obviously not 100%
sure if this does everything we need.
Thus, if you are interested in this functionality, please:
* try it now, check if the API does what you need and if not,
let me know!
* test it now, that way once we put it into a release we will
likely have a more stable API and implementation!
I should note that I've not done any tests on W32, I hope Evgeny will
get to this soon.
Happy hacking!
Christian
signature.asc
Description: OpenPGP digital signature
- [libmicrohttpd] Connection: Upgrade / WebSockets,
Christian Grothoff <=