The Puma
The Puma

Reputation: 1390

Will I get the same functionality without websockets in Heroku for a real-time node.js messaging app?

I have been making a node.jss + express + socket.io application on Heroku. I recently realized they don't support websockets, which would be ideal for real-time communication. They force you to use long polling, which uses http instead. I want to do this the right way, but on the other hand, I don't want to go through setting up this project again since it's just a proof of concept/getting me used to node.js.

What's the right move here? continue on heroku and then possibly change the app later to work with sockets, or start over using a different service than heroku? Things to take into consideration here are the amount of code I would have to change, and the loss of functionality for sticking with long polling instead of websockets. I have no idea how either of these will be effected.

Thank you

Upvotes: 2

Views: 409

Answers (2)

electrichead
electrichead

Reputation: 1160

If you want to just mess around with sockets and node, I'd recommend nodejitsu instead. I used it and was very happy with it. I am now back on Heroku though since it suits my needs better (and the apps don't require real-time interaction and polling is sufficient). Nodejitsu supports actual websockets.

Upvotes: 1

Pascal Belloncle
Pascal Belloncle

Reputation: 11389

socket.io works fine using xhr-polling instead of websocket. Performance will not be as good but very few cloud offerings support it for more than one instance today.

Now that nginx has support for websocket, this may change soon.

Upvotes: 5

Related Questions