I am running an embedded Jetty server on Ubuntu (22.04.3), listening to port 8734 (arbitrary number), and testing it with wscat.
The following command connects fine if run on the same machine:
wscat -c wss://myserver.com:8734/myservlet/
But fails to connect if I try to connect remotely (which is kind of the point of web-tech). It just hangs until timing out.
The Jetty server logs don't show anything.
That suggests the issue isn't in Jetty.
Could it be the firewall? I don't think so. The firewall is ufw
-- which reports:
Status: active
To Action From
-- ------ ----
8734 ALLOW Anywhere
8734 (v6) ALLOW Anywhere (v6)
I briefly tried sudo ufw disable
, and the wscat works/fails behaviour was unchanged.
What might be going wrong?
How can I debug this?
Thank you for any help!
(note: originally posted in StackOverflow - reposted here as it is likely to be an issue in server config rather than code)
ufw
alone is not enough, it only manages a subset of iptables. Check the rest of the rules. The firewall can also be outside of the machine.