tv icon indicating copy to clipboard operation
tv copied to clipboard

websocket default connection url is wrong

Open TangMonk opened this issue 9 years ago • 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

TangMonk avatar Feb 04 '17 09:02 TangMonk

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 avatar Feb 04 '17 09:02 Marsup

@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

TangMonk avatar Feb 27 '17 07:02 TangMonk

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

Marsup avatar Feb 27 '17 07:02 Marsup

@Marsup thanks !

TangMonk avatar Feb 27 '17 08:02 TangMonk

@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)

TangMonk avatar Apr 14 '17 10:04 TangMonk