outmoded / tv

Interactive debug console
Other
186 stars 41 forks source link

can not establish a connection to the server #100

Open guillaumevincent opened 9 years ago

guillaumevincent commented 9 years ago

Hi,

TV doesn't work if the hostname is not properly configured.

Firefox can not establish a connection to the server at ws://hostname:59755/

hostname should point to 127.0.0.1 in /etc/hosts. I know this is not related to TV, but maybe it could be noted in the doc ? (known issue)

geek commented 9 years ago

I think I'll move it to use the origins hostname serving the page, and use a websocket path instead of a separate listener/port.

guillaumevincent commented 9 years ago

yes maybe tv can use the host define in server.connection({host: 'localhost', port: 3000}); from hapi server

osukaa commented 9 years ago

I think my problem is related. Because when I access the Tv console I can see it but on the Chrome Dev Tools it shows -> _WebSocket connection to 'ws://localhost:42421/' failed: Error in connection establishment: net::ERR_CONNECTIONREFUSED

realyze commented 9 years ago

+1 seeing similar error with Chrome 41 on Mac Yosemite, node 0.12.0.

WebSocket connection to 'ws://tomass-mbp:59087/' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED

geek commented 9 years ago

@realyze when you register tv set the host option to localhost or 127.0.0.1 (https://github.com/hapijs/tv#options)

craigbeck commented 9 years ago

What about using the hostname form the request location? I've had the same issue where the hostname of the machine is not directly routable e.g. I can reach the debug console at http://myservice.example.com/debug/console but the hostname that the app tries to connect to is a hostname which is not routeable. See this PR: https://github.com/craigbeck/tv/pull/1