M
M
maksam072018-08-24 17:48:03
JavaScript
maksam07, 2018-08-24 17:48:03

How to update information on the site in real time?

Good afternoon. I see a lot of articles about Socket.io in conjunction with Node.js, but I have never used node, and have absolutely no idea how to install it on shared hosting. I often see entries that the socket needs to set the listening port, but how do I know which port to listen on? In general, if you can, explain to an outsider in this matter how to update information in real time and, preferably, without unnecessary troubles with hosting.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Belyaev, 2018-08-24
@bingo347

You won’t be able to install Node.js on classic shared hosting , you
will need your own server, since now virtual machines are usually cheaper than shared hosting,
although in this case you will have to configure everything yourself
about the port, but use any free one, the main thing is to be open to the outside, though it’s better through nginx to throw a proxy about Socket.io
- a creepy game, albeit hyped, but slow, with memory leaks, and generally a good example of how not to write ... Despite the fact that in 99% of cases the ws module on which it is based is enough, well, or take ws-api as a last resort if you need a high-level abstraction

K
Kirill Nesmeyanov, 2018-08-24
@SerafimArts

I have absolutely no idea how to install it on a virtual host

No way. That's why he is hosting, not VDS / VPS
The "netstat -a" command returns a list of ports that are listening. It remains to choose any free one, for example 3000, 8000, 81 and 8080 - these are the most popular for their stray.

L
lexa4ok93, 2018-08-24
@lexa4ok93

comet, long polling, pusher

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question