Category : websocket

I am new to web-sockets. I am trying to establish communication between client and server through web-socket. I follow the code from this link: https://phppot.com/php/simple-php-chat-using-websocket/ Here is my try: Client JS side: var ws = new WebSocket("ws://myIp:8090"); Server PHP side: define(‘HOST_NAME’,"myIP"); define(‘PORT’,"8090"); Now in the browser when I go for, http://localhost:8090: The initial handshake Request ..

Read more

I’m running the following Ratchet script on Debian; <?php use WorkermanWorker; require_once ‘/var/www/app/vendor/autoload.php’; // SSL context. $context = array( ‘ssl’ => array( ‘local_cert’ => ‘/var/www/app/certs/cert.pem’, ‘local_pk’ => ‘/var/www/app/certs/key.pem’, ‘verify_peer’ => false, ) ); // Create a Websocket server with ssl context. $ws_worker = new Worker(‘websocket://my.server.ip.address:2346’, $context); // Enable SSL. WebSocket+SSL means that Secure WebSocket (wss://). ..

Read more