0

Upon recommendation of a member of the stackoverflow forum, I hereby ask the following question in this forum, where it apparently fits better (I'm new to this forum).

What exactly I want:

A specific page of my website should load its content (html structure, representing a chat window) from the web server, but its chat functionality, present as PHP Ratchet script on the server-side (placed on the same web server), should work via a WebSocket connection.

In other words, for this specific page, Web Server and WebSocket connections should work simultaneously, while I have only one Apache (2.4) server, on a shared hosting basis, with no root access. And, as stated, both the chat application programmed in Ratchet and the website's HTML page are present on the web server.

When testing this on my localhost, this worked very nicely. When trying to deploy it on my web server however, I got into trouble, and seemingly need to employ an NGINX reverse proxy in front of my web server, or similar (http://socketo.me/docs/deploy). Is that even possible to deploy given my hosting conditions, or do I need to switch to another hosting type? I started with configuring NGINX, but the problem is that I can't actually modify the port to which my Apache Web Server is listening, given that I have no root access.. I feel that I need to switch my hosting type for this purpose?

One of the aspects of this question may be summed up to: Is it possible to place a reverse proxy in between the client and the browser for websocket purposes, when having a web server on a shared hosting basis, without root access?

1 Answer 1

1

Most shared hosting plans only allow you to accept connections on ports 80 (HTTP) & 443 (HTTPS) and do not give you access to the terminal.

Assuming this is the case, you cannot run a Ratchet WebSocket server since it requires terminal access and would be best hosted on a non-HTTP port.

I recommend you run the web server and WebSocket server on a dedication hosting plan where you'll have access to the terminal and have the ability to use any ports you like.

19
  • Yeah, it really looks like that's the better solution. The problem here is that most hosting companies make no security and maintenance work on dedicated or VPS, which is something I would prefer to remain having as a basic feature. So I'm trying to figure it out how I can display web pages and use websocket connections on the same page with one single web server, of a shared hosting account. Thanks for your comment anyway, actually didn't know about the port limit of shared hosting providers.
    – DevelJoe
    May 19, 2020 at 17:53
  • The problem here is that most hosting companies make no security and maintenance work on dedicated or VPS What do you mean by this? May 19, 2020 at 18:07
  • Also the port limit is from my experience with GoDaddy, could be different in your case. May 19, 2020 at 18:08
  • Well my host (which actually is GoDaddy for this current project) just informed me that if I switch to a dedicated hosting contract, they will do no more maintenance and security work concerning my server; then it would be all up to me (guess they just wanna exclude their liability from their client's eventual server mistakes). As I'm beginning with websockets etc. now only, I'd obviously prefer if that would keep being monitored too. I'm starting to actually wonder if it es even generally possible to employ websockets on a website hosted on a shared basis...?
    – DevelJoe
    May 19, 2020 at 18:10
  • If you are on the GoDaddy shared plan you 100% cannot run the Ratchet PHP WebSocket server since it requires terminal access, which does not come with the shared plan. May 19, 2020 at 18:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .