Closed arteymix closed 7 years ago
It could even be more generic in the sense that the protocol could promote the current I/O stream as a websocket connection and have WebSocket for any implementation that can bear a high TTL.
app.get ("/", ws ((req, res, next, ctx, ws) => {
ws.send_text ("message");
}));
The rest of the work will go in #206
Currently, libsoup-2.4 supports the WebSocket protocol and we could very well provide a server implementation that would use it as a transport layer. Once the handshake is initiated, the body streams would become suitable for passing messages.
Each flushed
write_all
(e.g.append
andappend_utf8
) would become a message and we could extend the current request API to read a "chunk" of data.