Skip to content

Instantly share code, notes, and snippets.

@payden
payden / gist:3328764
Created August 12, 2012 01:47
PHP WebSocket extension based on libwebsock.
How I want my websocket PHP extension to work:
(Something like this)
<?php
set_time_limit(0); //maybe do this inside extension, if possible?
$ws = new WebSocket("3333");
$ws->set_receive_callback(function($state, $msg) {
WebSocket::sendText($state->sockfd, $msg->text);
});