Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

socket.io creating 502 Bad Gateway on connect / websocket invalid

socket.io creating 502 Bad Gateway on connect / websocket invalid

Problem

I'm trying to get a simple socket.io server running:

Client:


var socket = io.connect("http://www.my-server.com:8080/");

The socket script is being served correctly. When the client connects, a

NetworkError: 502 Bad Gateway : http://www.my-server.com:8080/socket.io/1/websocket/20667461671864648294

occurs and the server prints:

warn - websocket connection invalid

I can't really find my problem. if it's a serverside/node problem, the socket.io.js script shouldn't be available, right?

What am i doing wrong?

Problem courtesy of: dvcrn

Solution

Got it.

I am using a CDN between user and server. After disabling boost/cache for my socket domain, the errors were gone and the socket became valid.

Should have thought of this earlier!

Solution courtesy of: dvcrn

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

socket.io creating 502 Bad Gateway on connect / websocket invalid

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×