http-server
http-server copied to clipboard
Implicit WebSocket support
This might be good idea to add implicit support for WebSocket.
Plan:
- Add "on_upgrade" callback for user that will allow or disallow further processing of possible WebSocket connection
- Add "on_error" callback to detect possible disconnection of client
- After upgrading "on_body" should be called with received WebSocket frames
- User should be aware that the client is upgraded to WebSocket or not (For example:
client->is_websocket). - Improve "pausing" API to allow pausing after receiving chunk of body to allow further "background processing"
- Allow possible "opt-out" by disabling WebSocket during compile time.
Possible implementations:
- https://github.com/tatsuhiro-t/wslay - This library seems to be good at embedding