2

I'm using a fresh ubuntu instance and got a sockjs server running on port 80. I can load it on the web browser but then it switches to long polling.

If I switch the port to 81 it all works fine. I even tried running my sockjs server on port 8000 and redirecting traffic from 80 to 8000 using iptables with no luck.

What could be causing this odd behaviour? I'm using EC2 with an Ubuntu 13.04 Linux VM

I have set all the firewall rules to allow traffic through, which it is going through since I can access it in the web browser its just its falling from websockets to using long polling which is really slow.

Tarang
  • 75,157
  • 39
  • 215
  • 276
  • Something proxying anything on port 80 (and not websocket-friendly) somewhere in your connection path could do this. – Mat Aug 04 '13 at 06:12
  • Im running it directly without anything in the middle – Tarang Aug 04 '13 at 06:15
  • I have this working on ec2 via nginx. If you want to give that a try, see my Q&A [here](http://stackoverflow.com/questions/18003689/recommended-nginx-configuration-for-meteor). – David Weldon Aug 09 '13 at 16:42

1 Answers1

0

I did have some problem and add this to iptables to allow Websockets

iptables -I INPUT -p tcp --dport 80 -m state --state NEW -j ACCEPT
iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -I OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
Alireza
  • 1,706
  • 16
  • 23