[Libwebsockets] Internet versus LAN connections

Willem Burgers wa.burgers+lws at gmail.com
Mon Aug 11 18:15:13 CEST 2014


I have a libwebsockets server running.
Whenever I try to connect over LAN, it works perfectly fine, but when I try
to connect over the Internet, the connection times out with error code 1006.
I have forwarded the websocket port on my router to the correct port for
the server.
In the JavaScript of the page I use the external IP obviously.
I tried a NodeJS echo server, which works fine over the Internet.
Also the libwebsockets-test-server works perfectly fine.

My HTTP callback just returns 0, because the html file is hosted on another

static int httpCallback(struct libwebsocket_context *context,
struct libwebsocket *wsi,
enum libwebsocket_callback_reasons reason,
 void *user, void *in, size_t len) {
    return 0;

Should this be changed for libwebsockets to work over the Internet?
Does it need to accept the Upgrade http request itself?
If so, why does it work over LAN connections?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20140811/30c6abca/attachment.html>

More information about the Libwebsockets mailing list