How to put SSL in this PHP Websokets system

Asked

Viewed 37 times

1

I created this chat on websokets but I can’t use it on my domain with SSL if someone can help http://rlag.esy.es/, are 2 code files to work 1 php executable and the front-end javascript could not find on the internet

I’m running the server on an Ocean digital cloud and the website on the Hostinger hosting

Part of server code

$secKey = $headers['Sec-WebSocket-Key'];
$secAccept = base64_encode(pack('H*', sha1($secKey . '258EAFA5-E914-47DA-95CA-C5AB0DC85B11')));
//hand shaking header
$upgrade  = "HTTPS/1.1 101 Web Socket Protocol Handshake\r\n" .
"Upgrade: websocket\r\n" .
"Connection: Upgrade\r\n" .
"WebSocket-Origin: $host\r\n" .
"WebSocket-Location: ws://$host:$port/demo/shout.php\r\n".
"Sec-WebSocket-Accept:$secAccept\r\n\r\n";
socket_write($client_conn,$upgrade,strlen($upgrade));
No answers

Browser other questions tagged

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