outmoded/tv

websocket default connection url is wrong

Opened this issue · 5 comments

Please see following image:
image

error below:

WebSocket connection to 'ws://wuao.lan:60668/' failed: Connection closed before receiving a handshake response

I think it should get host name in client side, instead of server side to avoid this problem

It seems to be a common problem on macos to have bad dns resolution on your local hostname, check your /etc/hosts file for any misconfiguration.

@Marsup I think the better way is this:

in file: https://github.com/hapijs/tv/blob/master/templates/index.html#L18

change

window.app.start(host, port);

to

window.app.start(location.host, port);

this way is no need to configuration the host, It more easy

It's working perfectly fine for everyone else. Fix your network or set the server host manually.

@Marsup thanks !

@Marsup Hi, I am deploy my hapi server to Google Cloud(Ubuntu 16.04) , But still same problem

image

It is meaning, that's not only my problem, it is affect Ubuntu server and OS X(CentOS and Debian are the same problem)