All Projects → GeniusesOfSymfony → Websocketphpclient

GeniusesOfSymfony / Websocketphpclient

Licence: mit
🗿 [DEPRECATED] PHP WAMPv1 compliant websocket client

Projects that are alternatives of or similar to Websocketphpclient

Websockets
Library for building WebSocket servers and clients in Python
Stars: ✭ 3,724 (+11912.9%)
Mutual labels:  websocket-client
Weapp.socket.io
A WebSocket client for building WeChat Mini Program implement by socket.io
Stars: ✭ 517 (+1567.74%)
Mutual labels:  websocket-client
Sylar
C++高性能分布式服务器框架,webserver,websocket server,自定义tcp_server(包含日志模块,配置模块,线程模块,协程模块,协程调度模块,io协程调度模块,hook模块,socket模块,bytearray序列化,http模块,TcpServer模块,Websocket模块,Https模块等, Smtp邮件模块, MySQL, SQLite3, ORM,Redis,Zookeeper)
Stars: ✭ 895 (+2787.1%)
Mutual labels:  websocket-client
Obs Websocket Js
Consumes https://github.com/Palakis/obs-websocket
Stars: ✭ 322 (+938.71%)
Mutual labels:  websocket-client
Pawl
Asynchronous WebSocket client
Stars: ✭ 448 (+1345.16%)
Mutual labels:  websocket-client
Mist
A distributed, tag-based pub-sub service for modern web applications and container-driven cloud.
Stars: ✭ 634 (+1945.16%)
Mutual labels:  websocket-client
Python Slack Sdk
Slack Developer Kit for Python
Stars: ✭ 3,307 (+10567.74%)
Mutual labels:  websocket-client
Docker Ws Client
docker websocket client for remote attch
Stars: ✭ 9 (-70.97%)
Mutual labels:  websocket-client
Websocket As Promised
A Promise-based API for WebSockets
Stars: ✭ 485 (+1464.52%)
Mutual labels:  websocket-client
Starscream
Websockets in swift for iOS and OSX
Stars: ✭ 7,105 (+22819.35%)
Mutual labels:  websocket-client
Redux Requests
Declarative AJAX requests and automatic network state management for single-page applications
Stars: ✭ 330 (+964.52%)
Mutual labels:  websocket-client
Websocket
The Hoa\Websocket library.
Stars: ✭ 421 (+1258.06%)
Mutual labels:  websocket-client
Ulfius
Web Framework to build REST APIs, Webservices or any HTTP endpoint in C language. Can stream large amount of data, integrate JSON data with Jansson, and create websocket services
Stars: ✭ 666 (+2048.39%)
Mutual labels:  websocket-client
Saea
SAEA.Socket is a high-performance IOCP framework TCP based on dotnet standard 2.0; Src contains its application test scenarios, such as websocket,rpc, redis driver, MVC WebAPI, lightweight message server, ultra large file transmission, etc. SAEA.Socket是一个高性能IOCP框架的 TCP,基于dotnet standard 2.0;Src中含有其应用测试场景,例如websocket、rpc、redis驱动、MVC WebAPI、轻量级消息服务器、超大文件传输等
Stars: ✭ 318 (+925.81%)
Mutual labels:  websocket-client
Oatpp Websocket
oatpp-websocket submodule.
Stars: ✭ 26 (-16.13%)
Mutual labels:  websocket-client
Websockex
An Elixir Websocket Client
Stars: ✭ 305 (+883.87%)
Mutual labels:  websocket-client
Autobahn Testsuite
Autobahn WebSocket protocol testsuite
Stars: ✭ 603 (+1845.16%)
Mutual labels:  websocket-client
Stl.fusion
Get real-time UI updates in Blazor apps and 10-1000x faster API responses with a novel approach to distributed reactive computing. Fusion brings computed observables and automatic dependency tracking from Knockout.js/MobX/Vue to the next level by enabling a single dependency graph span multiple servers and clients, including Blazor apps running in browser.
Stars: ✭ 858 (+2667.74%)
Mutual labels:  websocket-client
Awesome Websockets
A curated list of Websocket libraries and resources.
Stars: ✭ 850 (+2641.94%)
Mutual labels:  websocket-client
Gun
HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP.
Stars: ✭ 710 (+2190.32%)
Mutual labels:  websocket-client

NOTE - This repository is deprecated, future releases will only be made for critical bugs and security vulnerabilities. Use Pawl instead.

WebSocketPhpClient

Latest Stable Version Latest Unstable Version Total Downloads License

About

This package provides a PHP client that can send messages to a websocket server utilizing the WAMPv1 protocol. Listening for replies is not supported at this time.

Supported functions:

  • prefix
  • call
  • publish
  • event

Usage

Directly Create A Client

You can directly create a Gos\Component\WebSocketClient\Wamp\ClientInterface instance by creating a new Gos\Component\WebSocketClient\Wamp\Client object. The constructor has two mandatory requirements; the server host and port. You may review the Client class constructor to see all arguments.

<?php
use Gos\Component\WebSocketClient\Wamp\Client;

$client = new Client('127.0.0.1', 8080);

Through The Factory

A Gos\Component\WebSocketClient\Wamp\ClientFactoryInterface is available to create client instances as well. The default Gos\Component\WebSocketClient\Wamp\ClientFactory supports a PSR-3 logger and will automatically inject it into the client if one is present.

<?php
use Gos\Component\WebSocketClient\Wamp\ClientFactory;

$factory = new ClientFactory(['host' => '127.0.0.1', 'port' => 8080]);
$client = $factory->createConnection();

Interact With Server

Once you have created a client, you can connect and interact with your websocket server.

<?php
use Gos\Component\WebSocketClient\Wamp\ClientFactory;

$factory = new ClientFactory(['host' => '127.0.0.1', 'port' => 8080]);
$client = $factory->createConnection();

$sessionId = $client->connect();

// Establish a prefix on server
$client->prefix('calc', 'http://example.com/simple/calc#');

// You can send an arbitrary number of arguments
$client->call('calc', 12, 14, 15);

$data = [0, 1, 2];

// Or an array
$client->call('calc', $data);

$exclude = [$sessionId]; // No sense in sending the payload to ourselves
$eligible = []; // List of other clients ids that are eligible to receive this payload

$client->publish('topic', '', $exclude, $eligible);

// Publish an event
$client->event('topic', '');
$client->disconnect();

License

This software is distributed under MIT License. See LICENSE for more info.

Original Project

https://github.com/bazo/wamp-client

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].