I am trying to find a example which will explain me how to implement Client using libwebsocket, But I didn\'t get any convincing code. Is there any link that I can refer to?
I have code a simple echo server and client using libwebsockets in pure C.
The server side will do echo after it received the data from client.
The client side will write a hello message to server after the connection is established. Then after 2 seconds sleep, the client will call libwebsocket_callback_on_writable. You can see how it works.
I just upload the code on my Google drive.
My google drive link
You can compile the code by using below commands in the Terminal.
gcc example-server.c -o example-server -lwebsockets
gcc example-client.c -o example-client -lpthread -lwebsockets
Or, just use make on Terminal.