Create PHP WebSocket with SSL -


i have websocket chat on website , added ssl certificate website. when open website http, chat works. when open https it's not working. using javascript client chat ws:// protocol. changed protocol wss:// because of ssl encryption on page, won't work way. here's part of php server code creates 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); 

how add certificate php socket?

using different function call.

http://php.net/manual/en/function.stream-socket-client.php

and setting correct socket options

http://php.net/manual/en/context.ssl.php


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -

r - Update two sets of radiobuttons reactively - shiny -