]> granicus.if.org Git - libevent/commit
Add minimal WebSocket server implementation for evhttp (#1322)
authorDmitry Ilyin <dima@doty.ru>
Mon, 12 Sep 2022 19:16:56 +0000 (22:16 +0300)
committerGitHub <noreply@github.com>
Mon, 12 Sep 2022 19:16:56 +0000 (22:16 +0300)
commite8313084f9e8b064433cb10eb9a79bf87407fab6
tree9a98db8cb69dc07017512e0f28f9eb9bfe3b3a5c
parentbb41229ff4dbd62084994c6b0b2052a321fd0ccf
Add minimal WebSocket server implementation for evhttp (#1322)

This adds few functions to use evhttp-based webserver to handle incoming
WebSockets connections. We've tried to use both libevent and libwebsockets in
our application, but found that we need to have different ports at the same
time to handle standard HTTP and WebSockets traffic. This change can help to
stick only with libevent library.

Implementation was inspired by modified Libevent source code in ipush project
[1].

  [1]: https://github.com/sqfasd/ipush/tree/master/deps/libevent-2.0.21-stable

Also, WebSocket-based chat server was added as a sample.
19 files changed:
CMakeLists.txt
Doxyfile
Makefile.am
configure.ac
http-internal.h
http.c
include/event2/ws.h [new file with mode: 0644]
include/include.am
sample/include.am
sample/ws-chat-server.c [new file with mode: 0644]
sample/ws-chat.html [new file with mode: 0644]
sha1.c [new file with mode: 0644]
sha1.h [new file with mode: 0644]
test/include.am
test/regress_http.c
test/regress_http.h [new file with mode: 0644]
test/regress_ws.c [new file with mode: 0644]
test/regress_ws.h [new file with mode: 0644]
ws.c [new file with mode: 0644]