1

I recently found a script on GitHub which allows you to run a real-time Node.JS chat application, using Express and Socket.IO dependencies. I have uploaded it to my newly acquired DigitalOcean VPS, running Ubuntu 12.04.

It works, but is very slow to start with, i.e. it takes ~10 seconds to load, and when I run node app.js command via SSH, I get this debug info in my terminal - http://pastebin.com/r48xHN3m - the app starts up with socket.IO, BUT, on line 8 you can see that there's a clear socket.IO warning, stating that the websocket connection is invalid. And then it goes on to do some XHR polling after the timeout, and in the end of the debug info (line 38), you can see that a new user has joined the group, so it does work.

I've read a lot on the web about this, but I still can't solve the error. I tried using SSL (port 443), updating and upgrading all the dependencies, but those minor tweaks just don't do it...

P.S. My experimental site with the node app installed, but with socket.IO errors (running on port 3000) - chat.notepad.li

6
  • So what exactly is the problem here? Unless you want us to fix a random project on Github that is clearly not meant for production... Commented Jan 1, 2014 at 13:58
  • The problem is - I'm trying to figure out why I'm getting socket errors. Commented Jan 1, 2014 at 14:11
  • Wait, I think I know the source of my errors! I have an old version of nginx! Commented Jan 1, 2014 at 14:13
  • 1
    Here, this article (hopefully) will solve my problem - nolanlawson.com/2013/05/31/… Commented Jan 1, 2014 at 14:14
  • Great! If it solves it, please post it as an answer. Consider also making a pull request to the original developer with your modifications in a README Commented Jan 1, 2014 at 14:30

1 Answer 1

1

Update:

After scouring the web, I found out that all I needed to do was to first: upgrade my nginx installation, and secondly: update my nginx configuration block that is shown on this website. I then restarted the nginx service and, voila - the chat app loads up in less than a second. The website also stated that "SSL is apparently the way to go" -

Incidentally, it would have worked if I had used SSL on port 443. According to WebSocketsTest’s aggregate data, port 443 is supported about 89% of the time, compared to 78% for port 80.

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.