<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I have a libwebsockets server running.</div>

<div style="font-family:arial,sans-serif;font-size:13px">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.</div><div style="font-family:arial,sans-serif;font-size:13px">

I have forwarded the websocket port on my router to the correct port for the server.</div><div style="font-family:arial,sans-serif;font-size:13px">In the JavaScript of the page I use the external IP obviously.</div><div style="font-family:arial,sans-serif;font-size:13px">

I tried a NodeJS echo server, which works fine over the Internet.</div><div style="font-family:arial,sans-serif;font-size:13px">Also the libwebsockets-test-server works perfectly fine.</div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">My HTTP callback just returns 0, because the html file is hosted on another machine.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div>

<div style="font-family:arial,sans-serif;font-size:13px"><div>static int httpCallback(struct libwebsocket_context *context,</div><div><span style="white-space:pre-wrap">                                                     </span>struct libwebsocket *wsi,</div><div><span style="white-space:pre-wrap">                                                        </span>enum libwebsocket_callback_reasons reason,</div>

<div><span style="white-space:pre-wrap">                                                  </span>void *user, void *in, size_t len) {</div><div>    return 0;</div><div>}</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">

Should this be changed for libwebsockets to work over the Internet?</div><div style="font-family:arial,sans-serif;font-size:13px">Does it need to accept the Upgrade http request itself?</div><div style="font-family:arial,sans-serif;font-size:13px">

If so, why does it work over LAN connections?</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks,</div><div style="font-family:arial,sans-serif;font-size:13px">

Willem</div></div>