1

My CentOS 7 + CWP panel configured as:

Nginx & Apache Additional Options: php-cgi/suphp, nginx/php-fpm, apache/php-fpm, proxy HTTP: Nginx (80) --> Apache (8181) HTTPS: Nginx (443) --> Apache (8181)

I want to run a WebSocket application that using localhost address 0.0.0.0:8282 for communication So I have put a cron job to run my chatserver WebSocket app on each server boot using a command:

PHP index.php chatserver server

In the SSH console I can see that the server run without any issues:

Running server on host 0.0.0.0:8282

But in the browser client side I can see an error like that:

WebSocket connection to 'wss://.:8282/?' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED socket.js?v=:** WebSocket connection to 'wss://.:8282/?***' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

Looks like Nginx doesn't let to pass the socket connection on the port 8282. Could you please to help me to change the Nginx configuration file of the specific domain that works over SSL to successfully establish WebSocket connection to the port 8282 and connected to my localhost chatserver. I will appreciate any help.

Jms Digit
  • 11
  • 3

1 Answers1

0

The error dictates that the websocket could not connect via port 8282 you need to set up a TLS certificate for this since WebRTC requires secure connection.

I believe the answer to your question is here - How to Create Secure(TLS/SSL) Websocket Server

Godwin Kimani
  • 45
  • 1
  • 12