{"id":26337105,"url":"https://github.com/truewinter/websocket-test-server","last_synced_at":"2025-07-05T00:38:38.428Z","repository":{"id":64583107,"uuid":"576789789","full_name":"TrueWinter/websocket-test-server","owner":"TrueWinter","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-28T01:30:54.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T11:03:11.254Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TrueWinter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-11T01:24:09.000Z","updated_at":"2023-05-11T19:06:46.000Z","dependencies_parsed_at":"2023-02-15T13:45:43.164Z","dependency_job_id":null,"html_url":"https://github.com/TrueWinter/websocket-test-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrueWinter%2Fwebsocket-test-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrueWinter%2Fwebsocket-test-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrueWinter%2Fwebsocket-test-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrueWinter%2Fwebsocket-test-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TrueWinter","download_url":"https://codeload.github.com/TrueWinter/websocket-test-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814895,"owners_count":20352038,"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":[],"created_at":"2025-03-16T02:17:45.664Z","updated_at":"2025-03-16T02:17:46.201Z","avatar_url":"https://github.com/TrueWinter.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebSocket-Test-Server\n\nEver needed to test WebSockets on a website and wish you could send arbitrary data to the client without needing to rewrite the backend? Or maybe you're testing an integration with a 3rd-party WebSocket server but don't want to actually connect to their server during development? WebSocket-Test-Server can help.\n\n## Installation\n\n```\nnpm install --global websocket-test-server\n```\n\n## Usage\n\nTo use WebSocket-Test-Server, create a config file and then run `websocket-test-server` from the command line. The path to the config file must be absolute.\n\n```json\n{\n\t\"ws\": {\n\t\t\"routes\": [\n\t\t\t\"/eventsub\"\n\t\t],\n\t\t\"customRouteHandler\": \"\"\n\t},\n\t\"dashboard\": {\n\t\t\"port\": 8080\n\t}\n}\n```\n\n```\nwebsocket-test-server --config /path/to/config.json\n```\n\n## Advanced Usage\n\nThe routes registered in the config file cannot be automated using code. All data sent to the clients must be done manually though the dashboard.\n\nYou can register routes programatically by setting the `customRouteHandler` config option to the path of a file using the WebSocket-Test-Server API. The path can be either relative to the directory containing the config file, or absolute.\n\n```js\nmodule.exports = (api) =\u003e {\n\tapi.registerRoute('/echo', (ws) =\u003e {\n\t\tws.on('message', (data) =\u003e {\n\t\t\tlet d = data.toString();\n\t\t\tws.send(d);\n\t\t});\n\t});\n};\n```\n\nSee the file(s) in the `api-example` directory for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruewinter%2Fwebsocket-test-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftruewinter%2Fwebsocket-test-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruewinter%2Fwebsocket-test-server/lists"}