rickyrauch / Balloons.IO

Balloons.IO is a web multi-room chat server and client ready to use. It’s built with the help of node.JS, Express, Socket.IO and Redis. Balloons uses PassportJS for authentication with Twitter and Facebook
http://balloons.io
2.37k stars 493 forks source link

How to connect to a socket of php #77

Closed backdooooor closed 11 years ago

backdooooor commented 11 years ago

How to connect to a socket of php I'm trying to connect through the library http://elephant.io/ but he wrote me

debug - cleared heartbeat interval for client undefined You can write a list of parameters required for a successful connection? thanks in advance

cristiandouce commented 11 years ago

I believe that is a question for elephant.io. How are you using this with Balloons.IO?

backdooooor commented 11 years ago

example usage elephant.io require_once $_SERVER['DOCUMENT_ROOT'].'/protected/models/library/ElephantIO/Client.php'; require_once $_SERVER['DOCUMENT_ROOT'].'/protected/models/library/ElephantIO/Payload.php'; use ElephantIO\Client as Elephant; class Chats { static public function Send(){

$elephant = new Elephant('http://127.0.0.1:6789', 'socket.io', 1, false, true, true); //$data['nickname']="backdoor"; //$data['provider']="1"; $data['mgs']="тестовый реквест"; $data['room_id']="3f796c?"; $username="backdoor"; $provider="1"; $data['userKey']=$provider.":".$username; //$data['room_id']="09a451?s"; $elephant->init(); $elephant->send( ElephantIO\Client::TYPE_EVENT, null, null, json_encode(array('name' => 'my msg', 'args' => $data)) ); $elephant->close();

}

}