Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I send a JSON data with libwebsockets C library?

How do I send a JSON data with libwebsockets C library?

I've installed and tried the example codes, but I couldn't see any example on how to send data to localhost:someport, simply. Any help will be greately appreciated.

Here is the website of libwebsockets: http://libwebsockets.org/trac/libwebsockets

Here is the test-client.c file : http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/tree/test-server

Any help will be greately appreciated.

like image 350
mozcelikors Avatar asked Oct 21 '22 18:10

mozcelikors


1 Answers

I guess here is your example http://martinsikora.com/libwebsockets-simple-websocket-server

the author opens localhost server and connecting to it with safari.

Here is a sample for HTTP client in C if you want connect with C.

client

like image 107
Roma-MT Avatar answered Oct 24 '22 12:10

Roma-MT