Octamp WAMP is Router implementation of WAMP Protocol that scalable.
This was implemented using PHP OpenSwoole
Currently, the Adapter use for this is Redis.
Octamp Wamp is created using PHP with OpenSwoole instead of Ratchet / React PHP.
Octamp Wamp also support Horizontal Scaling with the help of Redis.
Session data and Wamp Datas will be save in Redis so that all node / server can access it.
Octamp Wamp | Thruway | |
---|---|---|
Horizontal Scalling | ✓ | ✗ |
Uses OpenSwoole | ✓ | ✗ |
Uses React PHP | ✗ | ✓ |
Octamp Wamp currently implemented using Basic Profile and Advance Profile and of WAMP Proto.
- PHP 8.2
- Redis Stack with Pub/Sub
- Openswoole
composer create-project octamp/wamp ./wamp
cd ./wamp
This will create the project in wamp folder
You can update the file /configs/adapter.yml
or copy to different file
And update the configuration
adapter:
type: redis
host: 0.0.0.0
port: 6379
# -- Uncomment the auth if you need username and password
# auth:
# username:
# password:
#
# -- Uncomment options if you need to include other redis option such as database
options:
database: 0
You can update the file /configs/transport.yml
or copy to different file
And update the configuration
transports:
- endpoint:
type: tcp
port: 8080
auths:
- method: anonymous
type: static
# -- You can add more method, such us the examples below
# - method: ticket
# type: dynamic
# authenticator: testing
# authenticatorRealm: realm1
# realms:
# - realm1
# - method: wampcra
# type: static
# users:
# - authid: auth
# secret: qa2/QVmmjSx1JJuyH5EI2gMDQf+ARnfwMcLOpUfln74=
# role: auth
# salt: salt1
# keylen: 32
# iterations: 1000
You can update the file /configs/realms.yml
or copy to different file
And update the configuration
realms:
- name: realm1
Copy the file .env
to .env.local
Update the necessary data
TRANSPORT_FILE=/configs/transport.yml
ADAPTER_FILE=/configs/adapter.yml
REALM_FILE=/configs/realms.yml
Now run the bin/server
php ./bin/server
That will now run the server
- High performance - Uses OpenSwoole, network framework based on an event-driven, asynchronous, non-blocking I/O coroutine programming model for PHP.
- Scalable - Designed for Horizontal Scalability.
- WAMP Basic Profile Features - This project implements most of the basic profile features in WAMP v2.
- Websocket Transport - Currently the project only implements websocket transport.
- Message Serializer - Accepts JSON and MessagePack.
- JSON
- MessagePack
Feature | Supported |
---|---|
Session Establishment | ✓ |
Session Close / Closing | ✓ |
Abort | ✓ |
Feature | Supported |
---|---|
Subscribe | ✓ |
Unsubscribe | ✓ |
Subscribe & Unsubscribe Error | ✓ |
Publish | ✓ |
Publish Error | ✓ |
Feature | Supported |
---|---|
Register | ✓ |
Unregister | ✓ |
Call | ✓ |
Call / Invocation Error | ✓ |
Caller Leaving | ✓ |
Callee Leaving | ✓ |
Feature | Supported |
---|---|
URI Validation | Partial |
Feature | Static | Dynamic |
---|---|---|
Anonymous | ✓ | ✓ |
Ticket | ✓ | ✓ |
Wamp-CRA | ✓ | ✓ |
Wamp-SCRA | ✗ | ✗ |
Cryptosign | ✗ | ✗ |
TLS | ✗ | ✗ |
Cookie | ✗ | ✗ |
Feature | Static |
---|---|
Authorization | ✗ |
Feature | Status |
---|---|
Progressive Call Results | ✗ |
Ignoring Requests for Progressive Call Results | ✗ |
Progressive Call Results with Timeout | ✗ |
Progressive Call Invocations | ✗ |
Call Timeout | ✗ |
Call Canceling | ✗ |
Call Re-Routing | ✗ |
Caller Identification | ✗ |
Call Trustlevels | ✗ |
Registration Meta API | ✗ |
Pattern-based Registration | ✓ |
Shared Registration | ✓ |
Sharded Registration | ✗ |
Registration Revocation | ✗ |
(Interface) Procedure Reflection | ✗ |
Feature | Status |
---|---|
Subscriber Blackwhite Listing | ✓ |
Publisher Exclusion | ✓ |
Publisher Identification | ✓ |
Publication Trustlevels | ✗ |
Subscription Meta API | ✗ |
Pattern-based Subscription | ✓ |
Sharded Subscription | ✗ |
Event History | ✗ |
Event Retention | ✗ |
Subscription Revocation | ✗ |
Session Testament | ✗ |
(Interface) Topic Reflection | ✗ |
Feature | Event | Procedure |
---|---|---|
Session Meta API | ✓ | ✓ |
Registration Meta API | ✓ | ✗ |
Subscriptions Meta API | ✗ | ✗ |
Feature | Status |
---|---|
Feature Announcement | ✓ |
RawSocket Transport | ✗ |
Batched WebSocket transport | ✗ |
Call Rerouting | ✗ |
Payload Passthru Mode | ✗ |
- Implement CBOR Serializer https://wamp-proto.org/wamp_bp_latest_ietf.html#name-serializers
- Remove Dependencies from Thruway Common
- Add OpenSwoole Table Adapter as Data Provider