tv
tv copied to clipboard
WebSocket connection fails on HTTPS
TV is unable to make a secure websocket connection over https, reporting the following error:
WebSocket connection to 'wss://05745327c4b9:55044/' failed:
Error in connection establishment: net::ERR_NAME_NOT_RESOLVED
The error points to line 43 of app.js which reads:
var ws = new WebSocket(protocol + host + ':' + port);
could you try setting yourself the host
property of Tv when registering the plugin?
Are you using this inside a docker container?
Yes, inside a Docker container. Setting the host property doesn't appear to help, which could be related to being inside a container.
Do you have the 55044
port mapped for the container?
You can set the websocket port manually. By default it's random but in the options there's a port property. :) El El lun, 21 de mar de 2016 a las 10:43 a.m., Fábio Martins < [email protected]> escribió:
I've got the same problem. I have my application inside a container and can't make it work. The main problem comes with the websocket port, which is always changing and for that reason I can't map it in the container configurations. Maybe we could add a web socket port to the TV options? Is there any alternative with the current release of the plugin?
— You are receiving this because you were assigned. Reply to this email directly or view it on GitHub https://github.com/hapijs/tv/issues/128#issuecomment-199371702
Sent from Inbox
I see something very similar. The error I get in chrome dev tools is: WebSocket connection to 'wss://127.0.0.1:54772/' failed: Error in connection establishment: net::ERR_CONNECTION_CLOSED
I have set the host
to '127.0.0.1'
in this case - I get the same thing if I set it to 'localhost'
or the name of the machine.
I am running the hapi site under a self-signed SSL cert. It also doesn't work on Safari - could it be related to the self-signed cert? When I run as http
everything seems to work fine.
@malsher did you ever figure this out?