Closed GuacheSuede closed 5 years ago
Thanks. Would it be through this? http://libdill.org/ws_attach_client.html
@rokf How would i retrieve the http body in a http server ? there are only command and resource fields
An example where a HTTP and WebSocket server are created can be found at https://github.com/sustrik/libdill/blob/master/examples/webapp.c
Look at the html_worker
function in that file, to see how to send a body to a client/browser.
ws_client_attach does HTTP handshake for you, however you can opt to do it by hand:
WS_NOHTTP flag can be combined with socket type flags. If set, the protocol will skip the initial HTTP handshake. In this case resource and host arguments won't be used and can be set to NULL. Skipping HTTP handshake is useful when you want to do the handshake on your own. For example, if you want to implement custom WebSocket extensions or if you want to write a multi-protocol application where initial HTTP handshake can be followed by different kinds of protocols (e.g. HTML and WebSocket).
(from ws_client_attach man page)
gotcha, thank you
http://libdill.org/documentation.html
There are quite a few WebSocket functions, including client ones. So yeah, you can create a WebSocket client with libdill.