R
R
rinaz222019-08-06 14:04:55
PHP
rinaz22, 2019-08-06 14:04:55

Is it possible to work with websocet on shared hosting?

Hello! Started learning websocket. And immediately a question arose. Is it possible to work with websocet on shared hosting? The hosting supports node.js, but unfortunately I don't know it. I started studying websocket in php, but unfortunately I have to work from the console, install libraries, etc. which in my case is also not suitable for 2 reasons. 1. Hosting does not have a console. 2. I don’t know how to work with libraries (.
I’m not going to change the hosting yet, so if it’s impossible to work with a web socket on such a hosting, then the following remains for me:
1) Forget about the web socket and work with AJAX
2) Start learning node.js

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grigory Vasilkov, 2019-08-06
@gzhegow

You can also connect to the socket from the usual page of the site, get what was thrown there and process it. But it's not very.
In the case of virtual hosting where there is no console, you can show off by searching the Cron scheduler and run a task like "execute this file once a year" - and it, in turn, is inside while true and will never end.
But if you start and blunt, then how will you kill the process? Yes, who the hell knows.
It is necessary to make support for the text "exit;" in your script-server. which comes to the socket and kills it)
But this is a uniform perversion, I answer
It will be easier to see the sockets in the node. Moreover, the whole difference is that in puff you raise nginx or apache to run scripts, and here you run some node express that does exactly the same

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question