0

I want to start a project of a web-based chatting app, i've looked on the internet and found out that there's two solutions other then ajax, long-polling and web-socket.

My problem lies that all web-socket tutorials is showing me how to do it on a localhost, although i own and plan on uploading it on a remote server bought online.

Is it possible to do web socket on a remote server? Or should i just stick with long polling?

[Edit:] More clarification:

This turtorial for example requires running a daemon script is it possible to create such script on remote servers like hostgator?

Thank you, i appreciate you help.

Jamil Hneini
  • 545
  • 3
  • 13

1 Answers1

1

It's always recommended to make use of websocket's in such cases , instead of pulling out the data from AJAX script, you can surely host the websocket in your hosting service if it allows HTTP port extension to allow websocket apart from HTTP. Also For having the best performance and full control of your setup you need "your own" server.

Today there are a huge amount of virtual server providers which means you get full control over your IP but where the physical server is still shared between many clients, meaning cheaper prices and more flexibility.

I recommend utilizing the free tier program at Amazon EC2, you can always resign after the free period. And they have many geographical locations to choose from.

You can probably find many more alternatives that suits your needs on the Webhosting talk forum

If you want to use a websocket server which you can start and stop at will I would much rather recommend a cloud solution. It's cheap and lets you interact with the server directly, which is most likely impossible with more traditional hosting providers. I've only used Amazon Web Services myself, they both have a free tier which you can use to build and test your websocket application. There are many more providers, also have a look at PaaS services like Nodejitsu. It all depends on what specific technologies you want to use I guess.

(note: AWS lets you SSH into your instance and you can use any platform/technology you want while GAE is web based and limited to Go, Java and Python. It doesn't mean AWS is better, again it depends on your case.)

U.Swap
  • 1,921
  • 4
  • 23
  • 41
  • I've been trying to avoid virtual servers, but i guess i have no choice i'm using php mostly, i'll see if we can afford it or just stick with long polling – Jamil Hneini Jul 28 '16 at 11:46