Issue Description: I have encountered a problem with my Node.js Socket.io server hosted on cPanel. My server successfully serves both HTTP and HTTPS content via the cPanel Application Manager. However, WebSocket connections are not working as expected. When attempting to connect to the WebSocket server using the following URLs:
wss://www.ws-broker.rightdev.co.uk/ ws://www.ws-broker.rightdev.co.uk/ I consistently receive a "Connection Failed" error in my browser.
The server correctly serves content from Express.js over HTTP and HTTPS. For demonstration purposes, I've included a simple "Access Denied" message on the homepage (https://www.ws-broker.rightdev.co.uk/). What I've Tried: To troubleshoot the issue, I experimented with alternative WebSocket connection URLs, such as:
ws://www.ws-broker.rightdev.co.uk:8443/ http://139.99.131.146:8443/ Surprisingly, these alternative URLs establish WebSocket connections without any issues, which suggests that my Node.js Socket.io server is functioning correctly.
Possible Cause: Based on these findings, it appears that the problem might be related to a proxy or configuration setting within the cPanel environment.
Request for Assistance: I am seeking advice and assistance from the Stack Overflow community to help me identify and resolve the issue that is preventing WebSocket connections from working on my primary domain (https://www.ws-broker.rightdev.co.uk/). Any insights, guidance, or solutions related to cPanel WebSocket configurations or proxy issues would be greatly appreciated.
If additional information or specific code/configuration details are needed to diagnose this problem, please let me know. Thank you for your support and expertise.