{"id":19020179,"url":"https://github.com/kanata-php/socket-conveyor-client","last_synced_at":"2026-06-20T19:32:33.393Z","repository":{"id":57365066,"uuid":"453854440","full_name":"kanata-php/socket-conveyor-client","owner":"kanata-php","description":"A client for the php package kanata-php/socket-conveyor","archived":false,"fork":false,"pushed_at":"2024-12-22T23:57:59.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-28T15:36:51.153Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kanata-php.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2022-01-31T02:08:06.000Z","updated_at":"2024-12-22T23:58:03.000Z","dependencies_parsed_at":"2024-11-08T20:26:07.349Z","dependency_job_id":null,"html_url":"https://github.com/kanata-php/socket-conveyor-client","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.2222222222222222,"last_synced_commit":"715711ad96127d9eb4a425e46a9ac1bafeb610a9"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/kanata-php/socket-conveyor-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanata-php%2Fsocket-conveyor-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanata-php%2Fsocket-conveyor-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanata-php%2Fsocket-conveyor-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanata-php%2Fsocket-conveyor-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kanata-php","download_url":"https://codeload.github.com/kanata-php/socket-conveyor-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanata-php%2Fsocket-conveyor-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34583589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-08T20:16:01.502Z","updated_at":"2026-06-20T19:32:33.374Z","avatar_url":"https://github.com/kanata-php.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"./imgs/logo.png\"/\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n  \u003ca href=\"https://www.npmjs.com/package/socket-conveyor-client\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Version\" src=\"https://img.shields.io/npm/v/socket-conveyor-client.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n\u003e A client for the php package kanata-php/socket-conveyor\n\n### 🏠 [Homepage](https://github.com/kanata-php/socket-conveyor-client#readme)\n\n## Prerequisites\n\n- npm \u003e=5.5.0\n- node \u003e=9.3.0\n\n## Install\n\n```sh\nnpm install socket-conveyor-client\n```\n\n\n\n## Description\n\n\n\nThis is a client for the [Socket Conveyor](https://github.com/kanata-php/socket-conveyor) PHP package..\n\n\n\n## Usage\n\n\n\nTo use this package, once it is installed, the following example shows how it works.\n\n```html\n\u003cdiv\u003e\n    \u003cdiv\u003e\u003cbutton onclick=\"connection.send('base', 'base-action')\"\u003eBase Action\u003c/button\u003e\u003c/div\u003e\n    \u003cdiv\u003e\u003cbutton onclick=\"connection.send('first', 'broadcast-action')\"\u003eBroadcast Action\u003c/button\u003e\u003c/div\u003e\n    \u003cdiv id=\"output\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n\u003cscript type=\"module\" type=\"text/javascript\"\u003e\n\n    // if this connection happens on a bundle, use it like this: import Conveyor from 'socket-conveyor-client';\n    import Conveyor from './node_modules/socket-conveyor-client/index.js';\n\n    window.connection = new Conveyor({\n        uri: '127.0.0.1',\n        port: 8181,\n        channel: 'actions-channel',\n        onMessage: (e) =\u003e {\n            document.getElementById('output').innerHTML = e;\n        },\n        onReady: () =\u003e {\n            connection.send('Welcome!');\n        },\n    });\n\n\u003c/script\u003e\n```\n\nWith the previous example your html client will try to connect to `ws://127.0.0.1:8000`. This client will connect to the channel `actions-channel`, and will listen to `example-first-action` actions. That said, any message sent to that **channel** and **action**, will be received at the `OnMessage` callback.\n\n## Options\n\n```\nprotocol: 'ws',\nuri: '127.0.0.1',\nport: 8000,\n\n// This is the auth used for authorization`\ntoken: null,\n\n// Url query for connection.\nquery: '',\n\nchannel: null,\nlisten: null,\nonOpen: this.onOpen.bind(this),\nonReady: () =\u003e {},\n\n// Message handler for only the data portion.\nonMessage: () =\u003e {},\n\n// Message handler for the whole incoming object.\nonRawMessage: () =\u003e {},\n\n// Callback triggered when closing connection. If overwritten the reconnection feature can be affected. \nonClose: () =\u003e this.onClose.bind(this),\n\n// Callback for securely do something when connection is closed, without affecting default closing connection behavior.\nonCloseCallback: () =\u003e {},\n\n// Callback for reconnection feature. Useful if you need to renew a token before attempting again. You might also want to check the method `setOption` for this, so you can change options during this procedure.\nonReconnectCallback: () =\u003e {},\n\nonError: () =\u003e {},\n\n// Settings for reconnection feature.\nreconnect: false,\nreconnectDelay: 5000,\n\n// Interval for connection verification, so reconnection action can take place if reconnection active.\nhealthCheckInterval: 3000,\n\n// Interval for connection heartbeat, so connection can be kept alive.\nheartBeat: true,\nheartBeatInterval: 10000,\n\n// Set the user identifier to be associated with this connection. \nuserId: null,\n\n// Set the client to automatically add id to messages so Conveyor can acknowledge them.\nacknowledge: false,\n```\n\n## Author\n\n👤 **Savio Resende**\n\n* Website: https://savioresende.com.br\n* GitHub: [@lotharthesavior](https://github.com/lotharthesavior)\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n## 📝 License\n\nCopyright © 2022 [Savio Resende](https://github.com/lotharthesavior).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanata-php%2Fsocket-conveyor-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkanata-php%2Fsocket-conveyor-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanata-php%2Fsocket-conveyor-client/lists"}