Is it possible to build Altime applications using "normal" hosting servers?

Asked

Viewed 584 times

0

Well, I’m creating a mini-forum, and I’ve come to the conclusion that the best way to build this forum is to use real time applications. However, for now, I host my site on a free server (like Hostinger), and so far I’ve only heard of Node.js with web socket to create this kind of application, and from what I can tell, it doesn’t work in the conventional way (I used to simply program on the localhost with Xampp, and if it worked I would upfile to the server using Filezilla and see the modification giving an F5 on the site. But apparently Node.js only works with VPS servers. So, there is some way to make a Realtime site without a VPS server?

I am currently using PHP, Mysql and Jquery.

  • 1

    Define Realtime. In the context of the question, I saw nothing that might have to do with the term.

  • Realtime as facebook chat.

  • 1

    If you’re talking about updating things without refresh, you already have a lot of questions solving this on the site. In fact, it has nothing to do with Realtime.

  • Yes, I know that, but most answers are using ajax to refresh the page from time to time. Only when I do this, it returns the tooodo content, even if it has no modification in it (like a new message in the chat), it brings all the messages every second, and not just the new ones every second. The websocket solves this problem, but it only works with VPS servers, so my question is how to make it work on a common hosting server.

  • 1

    Has answers about long Polling and websockets also, search on these terms. See a question that is very similar to your: Real time with PHP

  • 1

    websocket is not "Realtime", actually this is relative, anything can be "Realtime", like ajax. What you want is to be able to use websockets with PHP. Yes it is possible to write a socket like PHP, but it will run independently from Apache (xampp) and will also generate an "exclusive" port, now running this on the production server will depend on whether they have support, since it is "separate", in this case only contacting the dealer.

  • The problem with long pooling is that it consumes a lot of the server, and as I intend many functions (which would use long pooling), it would certainly require a very large server processing, and that would become a problem, because I still don’t intend to spend money to maintain a larger server, not to mention that maybe not even the larger server can account for so many requests.

  • And @Guilhermenascimento is precisely my question: If I can do something similar to webSockets on the same port as the production server. Or do something that works together with xampp, without having to open a specific port for it.

  • 1

    Regarding the question, the answer is that ajax works on virtually any server, long Polling and websockets depend on the hosting offer, the first because of the running time and the second because it is specific feature. And to know this, just by consulting each one of them. I don’t see much of an escape from it.

  • 3

    The term is one of the most poorly used I’ve ever seen. I came hot because I had a good answer, but the subject had nothing real time.

  • @kyro23 can not do on the same port, it is occupied by Apache, the server is Apache and not PHP, so it has to have a separate port, and to be able to run the socket on the server will only depend on the hosting, in fact I am almost sure that several companies "hosting" has "extra" services that can be contracted, just ask the sales sector if they have it.

  • @Guilhermenascimento So, this "extra" service that you refer to, is precisely the VPS that I talked about, I need it to run on the common server. Is there a framework or something that does something similar to what the websocket does and does not use different ports?

  • @kyro23 is like I said before, there is no way to run, the port is already occupied by Apache, PHP is not the server in common HTTP hosts, the server is Apache, a PHP framework will not solve.

  • @Guilhermenascimento I get it. So I’m going to test with long pooling and web sockets and see what’s best for my application. Thank you :)

  • @kyro23 long-Poll may even "solve", but I find a shady technique, laborious and that in a stream of many accesses does not seem to solve anything, on the contrary, it may even get worse compared to a normal request.

Show 10 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.