WebSocketBundle icon indicating copy to clipboard operation
WebSocketBundle copied to clipboard

WebSocket connection to 'ws://IPDEVSERVER:8080/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED, ok on localhost

Open philou77 opened this issue 8 years ago • 12 comments

Hello ALL !

My project is ok on my local but i try to push my project on my dev server ...

this is my config.yml file gos_web_socket: server: port: 8080 #The port the socket server will listen on host: 127.0.0.1 #The host ip to bind to router: resources: - @ApplicationFrontFrontBundle/Resources/config/pubsub/routing.yml

So i launch my gos server like this

root@dev:/var/www/dev.xxxx.com/#php app/console gos:websocket:server [2017-07-19 14:24:59] websocket.INFO: Starting web socket
[2017-07-19 14:24:59] websocket.INFO: Launching Ratchet on 127.0.0.1:8080 PID: 24474

Server seems to be ok but when i try to connect like this

var ws = WS.connect("ws://IPDEVSERVER:8080"); // i try also with hostname dev.** but same error ws.on("socket/connect", function(session){ });

I have error in my console WebSocket connection to 'ws://IPDEVSERVER:8080/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

I have check my firewall but there is nothing ( by journalctl -xe )

thx for your help !!! philou

philou77 avatar Jul 19 '17 15:07 philou77

Try binding to 0.0.0.0

OO00O0O avatar Jul 20 '17 07:07 OO00O0O

thx BunnyHolder ! perfect !

philou77 avatar Jul 20 '17 08:07 philou77

thx bro !

sanggi-wjg avatar Dec 20 '17 02:12 sanggi-wjg

Try binding to 0.0.0.0

@BunnyHolder Can you kindly explain what do you mean by binding to 0.0.0.0 ? I m using spring boot with angular. I serve the angular with ng server --host 0.0.0.0 and run my spring boot on a PC. On a different PC on the same network, i can render the angular app, everything is ok, i only get this same error regarding websocket "websocket connection to localhost:8080/api/socket" failed, error in connection establishment Kind regards,

gxg10 avatar Feb 02 '19 12:02 gxg10

Try binding to 0.0.0.0

I love u bro u saved me :)))))))

rasoul707 avatar Sep 07 '19 14:09 rasoul707

Hello!

I got the same error : I fix it by allowing the COOKIES in my web browser(Chrome for me).

Let me know if it worked for you

KodjoDev avatar May 17 '20 11:05 KodjoDev

Try binding to 0.0.0.0

YEAH!!!!! It worked!! :)

dataf3l avatar Sep 02 '20 08:09 dataf3l

@dataf3l @rasool707 What does mean by binding with 0.0.0.0

bilalswiftsolutions avatar Oct 02 '20 11:10 bilalswiftsolutions

还是不行 springcloud

WebSocket connection to 'ws://192.168.1.13:9666/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

tinarooot avatar Dec 16 '20 02:12 tinarooot

@bilalswiftsolutions https://github.com/thoughtbot/til/blob/master/docker/binding-to-0-0-0-0-in-rails.md

dataf3l avatar Dec 16 '20 05:12 dataf3l

还是不行 springcloud

WebSocket connection to 'ws://192.168.1.13:9666/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

我也一样

wilding96 avatar Aug 19 '21 07:08 wilding96

还是不行 springcloud WebSocket connection to 'ws://192.168.1.13:9666/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

我也一样

删除掉重新来,我就解决了

tinarooot avatar Aug 19 '21 07:08 tinarooot