Skip to content

Instantly share code, notes, and snippets.

@quest
Last active August 29, 2015 14:08
Show Gist options
  • Save quest/2f85c56022491c8aaefc to your computer and use it in GitHub Desktop.
Save quest/2f85c56022491c8aaefc to your computer and use it in GitHub Desktop.
ElephantIO
public $components = array(
'ElephantIO.ElephantIO' => array(
'url' => 'http://127.0.0.1:3000', //IP:PORT to SocketIO
'version' => '1X', //1X or 0X
'options' => array() // only for 1x, see more: https://github.com/Wisembly/elephant.io/blob/master/src/Engine/AbstractSocketIO.php#L199
)
);
public function index() {
$this->ElephantIO->init(); // connect to socket.io
$this->ElephantIO->emit('set nick', array('nickname' => 'Victor')); // emit 'set nick'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment