0

I have a server side js script which was working some time ago. I tried to start it yesterday and faced this error when I was trying to connect to the server socket:

WebSocket connection to 'wss://ohrana.ua:55533/' failed

The dump of the error is:

bubbles: false
cancelBubble: false
cancelable: false
composed: false
currentTarget: WebSocket {url: "wss://ohrana.ua:55533/", readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …}
defaultPrevented: false
eventPhase: 0
isTrusted: true
path: []
returnValue: true
srcElement: WebSocket {url: "wss://ohrana.ua:55533/", readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …}
target: WebSocket {url: "wss://ohrana.ua:55533/", readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …}
timeStamp: 2467.9999999934807
type: "error"

It looks like the request from browser doesnt even reach the script because something is blocking it. I cant understand what is wrong because some time ago everything was working fine.

I am starting js script like this:

node /home/admin/web/ohrana.ua/public_html/webrtc/pinrtc_socket.js

also I have executed these commands:

sudo iptables -t filter -A INPUT -p udp --dport 55533 -j ACCEPT
sudo iptables -t filter -A INPUT -p tcp --dport 55533 -j ACCEPT

also I have turned firewall of.

But I still cant connect to the socket and it gives me that same error.

Can anyone give me some advice what I am doing wrong and how to trace what stops the script from working?

Any help appriciated!

1 Answer 1

1

tcptraceroute shows that the packet gets rejected from your host and not something in front of your host. Thus either firewall settings on your host deny access or the service is simply not running.

Tracing the path to 185.86.78.52 on TCP port 55533, 30 hops max
 ...
 6  194.44.212.36  61.352 ms  60.684 ms  61.477 ms
 7  194.44.6.58  69.631 ms  69.291 ms  69.783 ms
 8  331192-vds-lg290985psv.gmhost.pp.ua (185.86.78.52) [closed]  73.058 ms  70.584 ms  70.498 ms

Trying a different port with no service shows a different behavior, i.e. the packets seems to be dropped by your firewall:

Tracing the path to 185.86.78.52 on TCP port 55532, 30 hops max
 ...
 6  194.44.212.254  62.946 ms  56.673 ms  57.019 ms
 7  194.44.6.58  64.873 ms  64.716 ms  64.792 ms
 8  * * *

Therefore I would guess that the firewall either allows access and there is no service running on port 55533, or that the firewalls explicitly rejects connections (instead of dropping as done on the other port). I recommend to check with netstat -nlpt that there is actually something listening on port 55533.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.