I have a websocket chat on my website and I recently added SSL certificate to my website. When I open my website with http
, chat works. When I open it with https
it's not working. I am using javascript as client for my chat with ws://
protocol. I changed that protocol to wss://
because of SSL encryption on my page, but it won't work that way. Here's part of my PHP server code that creates the socket:
$host = 'localhost';
$port = '9000';
$null = NULL;
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1);
socket_bind($socket, 0, $port);
socket_listen($socket);
$clients = array($socket);