octamp/wamp

WAMP Router

Maintainers

Details

github.com/octamp/wamp

Source

Issues

Installs: 8

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:project

v1.2.0-ALPHA2 2024-09-21 14:43 UTC

This package is auto-updated.

Last update: 2024-11-05 15:52:11 UTC


README

Octamp WAMP is Router implementation of WAMP Protocol that scalable.

This was implemented using PHP OpenSwoole

Currently, the Adapter use for this is Redis.

Why Use Octamp Wamp

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.

Comparison with other Implementation

Profile

Octamp Wamp currently implemented using Basic Profile and Advance Profile and of WAMP Proto.

How to use

Prerequisite

  • PHP 8.2
  • Redis Stack with Pub/Sub
  • Openswoole

Installation

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

Octamp Wamp Features

  • 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.

Message Serializer

  • JSON
  • MessagePack

Basic Profile Feature Support

Sessions

Publish and Subscribe

Remote Procedure Calls

Other Features

Advance Profile Feature Support

Authentication

Authorization

RPC Features

PubSub Features

Meta API

Others

TODOs