question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"WebSocket connection to .. failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED"

See original GitHub issue

I’m using Thruway and AutobahnJS in a project. Everything works fine on my development machine (Windows running WampServer), but when I tried deploying on my live server I found Autobahn is unable to connect to Thruway.

Here’s my JS code:

var connection = new autobahn.Connection({
    url: 'ws://www.pricewombat.com:9090',
    realm: 'restricted_realm'
});

connection.open();

The error shown in Chrome’s console is:

WebSocket connection to ‘ws://www.pricewombat.com:9090/’ failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

The error shown in IE’s console is:

SCRIPT12029: WebSocket Error: Network Error 12029, A connection with the server could not be established

I have port 9090 opened in the TCP_IN and TCP_OUT lists in my firewall and my hosting company confirmed the port is open.

I believe Thruway is working correctly because when I try pushing a message from a PHP file the SimpleWsServer.php process outputs debug info showing the message was received, but no output is shown when Autobahn tries to connect.

I’m not 100% sure this is an AutobahnJS issue, but do you have any ideas as to what might be causing this error?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
ghostcommented, Nov 6, 2016

Can you guys show me where in the Thruway code you can change 127.0.0.1 to 0.0.0.0?

12reactions
mbonneaucommented, Mar 27, 2015

Do you have Thruway listening on 127.0.0.1 instead of 0.0.0.0?

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Failed: Error in connection establishment: net ...
Firstly, I would try a non-secure websocket connection. So remove one of the s 's from the connection address:
Read more >
Websocket connection failed: Error in connection establishment
I am working on video conferencing with mediasoup demo but i am getting this error: WebSocket connection to 'wss://videocall.test.com:4443/?
Read more >
WebSocket connection to 'ws://localhost:1234/tiptap' failed
I'm trying to understand how to use local websocket server. How to solve the problem?
Read more >
Error with WebSocket - Microsoft Q&A
Hello I get the error: WebSocket connection to 'wss://localhost:54970/Dashboard.Server/' failed: Error in connection establishment: net:: ...
Read more >
WebSocket connection failed: Error in connection establishment
Hi, I'm trying to set up red5pro on an AWS linux instance. I've set up SSL and I'm trying to broadcast a stream...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found