[Libwebsockets] Seeking advice on the best libwebsockets server implementation for my scenario

biolaser at frii.com biolaser at frii.com
Fri Feb 12 23:54:36 CET 2021

My scenario is as follows:

All players in the following scenario currently reside on the same Windows
10 PC. But a scenario where the elements are distributed is also possible
in future.

But for now:

I want to connect a locally-hosted web page (HTML and Javascript hosted by
Python simple HTTP server) to a local server I will write in C, leveraging
libwebsockets for the connection to the web page and Winsock for a totally
separate connection to yet another local C++ application (an Editor).

So the C libwebsockets server would host a connection to each of two
different clients using two different libs - libwebsockets and Winsock.
These should be totally independent of each other within that server.

I want to pass simple integer data from the web page (initiated by
user-clicks) to the server over libwebsockets, then pass that data further
along to another local C++ application (an Editor) over Winsock.

In this scenario data travels from web page to libwebsockets server and is
always initiated from the web page client. But in future I may wish to
initiate from the local C++ application (an Editor) and send data to the
server and then finally up to the web page.

I have already written the code for the Winsock server and client
connection and it is working - I need to add the web socket logic to the
server using libwebsockets.

What would be the best implementation of libwebsockets to employ to
enhance my server to be able to do web socket connection to the web page? I
don't need to worry about libwebsockets client, since I can use Javascript
in the web page to get a connection to the libwebsockets server.

More information about the Libwebsockets mailing list