Theldus / wsServer

wsServer - a tiny WebSocket server library written in C
https://theldus.github.io/wsServer
GNU General Public License v3.0
422 stars 80 forks source link

Problems with browsers connections #69

Closed SteMMo33 closed 1 year ago

SteMMo33 commented 1 year ago

Hi, I'm embedding the library in my GTK/C application on Linaro machine. I need to connect the application (server) with a web page (client) - so by the javascript WebSocket object.

On the C side I started the server with:

ws_socket(&evs, 8080, 1, 1000); cause I need other C routines run. On the browser side I try to connect with: var socket = new WebSocket("ws://localhost:8080");

As reply I always receive the error: WebSocket connection to 'ws://localhost:8080/' failed:

On the C side I see the output in console Waiting for incoming connections... and no other. If I check the opened port by 'netstat -a ' I don't see the waiting 8080 port.

Any Idea? Thank a lot!

ADDED: by the 'netstat -ap --numeric-ports' I see the following output: # netstat -ap | grep rech tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 10700/lockrecharge unix 3 [ ] STREAM CONNECTED 1571165 10700/lockrecharge unix 3 [ ] STREAM CONNECTED 1577223 10700/lockrecharge `

So the socket is listening!

SteMMo33 commented 1 year ago

I'm very sorry .. the server is listening and working.