{"id":15296468,"url":"https://github.com/cydrickn/octamp-client","last_synced_at":"2025-04-13T19:41:38.512Z","repository":{"id":65667227,"uuid":"594730148","full_name":"cydrickn/octamp-client","owner":"cydrickn","description":"WAMP Client for PHP Swoole","archived":false,"fork":false,"pushed_at":"2023-10-15T03:57:33.000Z","size":346,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T17:41:42.583Z","etag":null,"topics":["autobahn","openswoole","php","php8","pubsub","real-time","rpc","swoole","wamp","wamp-client","wamp-protocol","websocket"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cydrickn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-29T13:23:43.000Z","updated_at":"2023-09-23T06:37:44.000Z","dependencies_parsed_at":"2024-09-30T18:10:42.758Z","dependency_job_id":null,"html_url":"https://github.com/cydrickn/octamp-client","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":0.06896551724137934,"last_synced_commit":"0b53f2191cbd90c7c03d5dc486304445a925789e"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cydrickn%2Foctamp-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cydrickn%2Foctamp-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cydrickn%2Foctamp-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cydrickn%2Foctamp-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cydrickn","download_url":"https://codeload.github.com/cydrickn/octamp-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248770661,"owners_count":21159014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autobahn","openswoole","php","php8","pubsub","real-time","rpc","swoole","wamp","wamp-client","wamp-protocol","websocket"],"created_at":"2024-09-30T18:10:38.795Z","updated_at":"2025-04-13T19:41:38.489Z","avatar_url":"https://github.com/cydrickn.png","language":"PHP","readme":"# Octamp Client\n\n\n[![Packagist PHP Version](https://img.shields.io/packagist/dependency-v/octamp/client/php?style=flat-square)](https://packagist.org/packages/octamp/client)\n[![License](https://img.shields.io/packagist/l/octamp/client?style=flat-square)](/LICENSE)\n[![Test](https://github.com/cydrickn/octamp-client/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/cydrickn/octamp-client/actions/workflows/test.yml)\n[![codecov](https://codecov.io/github/cydrickn/octamp-client/branch/main/graph/badge.svg?token=8Y8BNJE1VG)](https://codecov.io/github/cydrickn/octamp-client)\n\nOctamp Client is an open source client for [WAMP (Web Application Messaging Protocol)](https://wamp-proto.org/), for PHP.\n\nOctamp Client uses [Open Swoole](https://openswoole.com/docs), is a high-performance network framework based on an event-driven, asynchronous, non-blocking I/O coroutine programming model for PHP.\n\nWe also design the Octamp Client functions to be identical to [AutobahnJS](https://github.com/crossbario/autobahn-js)\n\nThe name Octamp is from Octopus + WAMP\n\n## Supported WAMP Features\n\n- Publish\n- Subscribe\n- Call\n- Call Progressive\n- Register\n\n## Requierements\n\n- PHP \u003e= 8.1\n- Swoole / OpenSwoole Extension\n\n## Installation\n\n```sh\ncomposer require octamp/client\n```\n\n## Example\n\n```php\n\u003c?php\n\nuse Octamp\\Client\\Auth\\WampcraAuthenticator;\nuse Octamp\\Client\\Peer;\nuse Octamp\\Client\\Session;\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\n\n\\Co\\run(function () {\n    $client = new Peer('crossbar', 9000);\n    \n    $client-\u003eonOpen(function (Session $session) {\n        // subscribe\n        $session-\u003esubscribe('hello', function (array $args) {\n            echo 'Event ' . $args[0] . PHP_EOL;\n        });\n    \n        // publish\n        $session-\u003epublish('hello', ['hello octamp'], [], ['exclude_me' =\u003e false]);\n    \n        // publish with acknowledgement\n        $session\n            -\u003epublish('hello', ['hello octamp with acknowledgement'], [], ['acknowledge' =\u003e true, 'exclude_me' =\u003e false])\n            -\u003ethen(\n                function () {\n                    echo 'Publish Acknowledged!' . PHP_EOL;\n                },\n                function ($error) {\n                    echo 'Publish Error ' . $error . PHP_EOL;\n                },\n            );\n    \n        // register\n        $session-\u003eregister('add', function (array $args) {\n            return $args[0] + $args[1];\n        });\n    \n        // call\n        $session-\u003ecall('add', [1, 3])-\u003ethen(function ($result) {\n            echo 'Result ' . $result . PHP_EOL;\n        });\n    });\n    \n    $client-\u003eopen();\n});\n\n```\n\n## TODOs\n\n- Call Cancel\n- Call Timeout\n- Unsubscribe\n- RPC Progress Call\n- Auto Reconnect\n- Subprotocol Handling\n- Heartbeat\n- Custom Error Handling\n- TLS connection\n- Session Logging\n- Session Prefix\n- Pattern Base Subscription / Registration\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcydrickn%2Foctamp-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcydrickn%2Foctamp-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcydrickn%2Foctamp-client/lists"}