https://github.com/up9cloud/engine.io-php-client
php communicate with engine.io server.
https://github.com/up9cloud/engine.io-php-client
Last synced: 8 months ago
JSON representation
php communicate with engine.io server.
- Host: GitHub
- URL: https://github.com/up9cloud/engine.io-php-client
- Owner: up9cloud
- License: mit
- Created: 2015-08-21T10:06:14.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2023-04-16T17:37:42.000Z (about 3 years ago)
- Last Synced: 2025-03-26T07:23:10.640Z (about 1 year ago)
- Language: PHP
- Size: 42 KB
- Stars: 1
- Watchers: 0
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# engine.io-php-client
The php client for [engine.io](https://github.com/socketio/engine.io).
| version | engine.io version |
| ------- | ----------------- |
| v1 | v1 |
| v2 | v2, v3 |
## Installation
```bash
composer require up9cloud/engine.io-php-client
```
## Usage
```php
require_once __DIR__.'/vendor/autoload.php';
use eio\Client;
$client = new Client('ws://localhost:9527');
$client->send(json_encode([
'channel'=>'all',
'message'=>'helloworld'
]));
```
### Advanced
```php
require_once __DIR__.'/vendor/autoload.php';
use eio\Client;
$options = [
// TODO: see src/Transport.php
];
// builtin debug method
$debug = true;
// custom debug method
$debug = function ($time, $messages){
printf('[%.4f]: %s' . PHP_EOL, $time, $messages);
};
$client = new Client($uri, $options, $debug);
```