Installing/setting up Socket.IO on my server

前端 未结 3 659
我在风中等你
我在风中等你 2021-02-06 09:42

Ok so I have read through the Socket.IO docs and I am still a little unsure of a couple of points:

The documentation says...

To run the demo, execute the followi

3条回答
  •  隐瞒了意图╮
    2021-02-06 10:38

    If you aren't familiar with node.js or with basic command line usage then I would suggest that you use a hosted WebSockets solution like pusherapp. Trying to learn WebSockets, and Node.js, and the Linux command line all at once is going to lead to a lot of frustration. Take a look a pusherapp's quick start guide, it's very easy to get started. You can have 5 simultaneous connections with a single application for free (I'm not affiliated with pusherapp).

    Updated (with inline answers to questions):

    If you are going to go the direction of running a Socket.IO application:

    • You don't technically need git since you can download node.js and Socket.IO from their respective download links on github.

    • You don't actually need a LAMP server to use Socket.IO. By default Socket.IO functions as a simple webserver in addition to a WebSockets server. If you want server side scripting then you might want Apache with mod_php, mod_python, etc.

    • You don't technically need a dedicated server or even root access. You do need a system where you can have long running process. And if you want the service to start automatically when the system is rebooted, you probably want to add a startup file to /etc/init.d, /etc/rc.d which will require root access. Both node.js and Socket.IO can be installed and run from a normal home directory. If you want to run Socket.IO on a standard port like 80 or 443 then you will need to run it with root privilege.

    • Node.JS scales quite well so Socket.IO will probably scale pretty well too.

    • It's not a simple matter to get everything setup and working, but if your goal is a free solution for web serving+WebSockets then Socket.IO is probably is good route to at least explore if you are brave.

提交回复
热议问题