{"id":16271126,"url":"https://github.com/hans00/fastws","last_synced_at":"2025-10-05T09:30:26.104Z","repository":{"id":40390613,"uuid":"221465566","full_name":"hans00/fastWS","owner":"hans00","description":"Simple Node.js server based on uWebSockets","archived":false,"fork":false,"pushed_at":"2023-02-27T14:10:28.000Z","size":2386,"stargazers_count":27,"open_issues_count":10,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-06T09:25:43.349Z","etag":null,"topics":["javascript","nodejs","uwebsockets","websocket"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hans00.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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":"2019-11-13T13:28:01.000Z","updated_at":"2023-07-25T09:06:37.000Z","dependencies_parsed_at":"2024-10-27T21:38:57.452Z","dependency_job_id":"4c648797-beed-4c16-b123-5815ca258de4","html_url":"https://github.com/hans00/fastWS","commit_stats":{"total_commits":495,"total_committers":5,"mean_commits":99.0,"dds":0.501010101010101,"last_synced_commit":"1fc42145aadac5b074522f1150f02a42960fcf8f"},"previous_names":[],"tags_count":78,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hans00%2FfastWS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hans00%2FfastWS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hans00%2FfastWS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hans00%2FfastWS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hans00","download_url":"https://codeload.github.com/hans00/fastWS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235378944,"owners_count":18980492,"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":["javascript","nodejs","uwebsockets","websocket"],"created_at":"2024-10-10T18:12:33.776Z","updated_at":"2025-10-05T09:30:25.576Z","avatar_url":"https://github.com/hans00.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"fastWS\n=====\n\n[![GitHub Action](https://github.com/hans00/fastWS/workflows/build/badge.svg)](https://github.com/hans00/fastWS)\n[![codecov](https://codecov.io/gh/hans00/fastWS/branch/master/graph/badge.svg?token=5P1YR45NCD)](https://codecov.io/gh/hans00/fastWS)\n\nIt's very fast Web Server Node.js server based on uWebSockets.\n\nAnd very easy to use.\n\n[Benchmark result](benchmark/README.md)\n\n[Documents](docs/README.md)\n\n[Server package](packages/server)\n\n[Client package](packages/client)\n\nUsage\n---\n\n`npm i fast-ws-client fast-ws-server`\n\n### Server\n\n```js\nconst fastWS = require('fast-ws-server')\n\nconst app = new fastWS({ /* options */ })\n\napp.ws('/ws', ws =\u003e {\n  console.log(`Connected ${ws.remoteAddress}`)\n\n  ws.on('message', ({ data }) =\u003e {\n    ws.sendMessage(data)\n  })\n\n  ws.on('echo', ({ reply, data }) =\u003e {\n    reply(data)\n  })\n})\n\napp.post('/post', async (req, res) =\u003e {\n  const data = await req.body()\n  res.json(data)\n})\n\napp.get('/hello/:name', async (req, res, params) =\u003e {\n  res.render([\n    '\u003chtml\u003e',\n    '\u003chead\u003e\u003ctitle\u003eHello\u003c/title\u003e\u003c/head\u003e',\n    '\u003cbody\u003e\u003ch1\u003eHello, ${escapeHTML(name)}\u003c/h1\u003e\u003c/body\u003e',\n    '\u003c/html\u003e'\n  ].join(''), params)\n})\n\napp.get('/hello/:name/alert', async (req, res, params) =\u003e {\n  res.render([\n    '\u003chtml\u003e',\n    '\u003chead\u003e\u003ctitle\u003eHello\u003c/title\u003e\u003c/head\u003e',\n    '\u003cbody\u003e\u003cscript\u003ealert(\"Hello, ${escapeVar(name, String)}\")\u003c/script\u003e\u003c/body\u003e',\n    '\u003c/html\u003e'\n  ].join(''), params)\n})\n\napp.serve('/*') // auto serve project /static/*\n\napp.listen(3000, () =\u003e {\n  console.log('Listen on 3000')\n})\n```\n\n### Client\n\n```js\nconst Client = require('fast-ws-client')\n\nconst client = new Client('ws://server/fast-ws', options)\n\nclient.on('connect', () =\u003e {\n  client.emit('event name', 'message')\n})\n\nclient.on('event name', async () =\u003e {\n  await client.emit('wait for remote', 'message', true)\n})\n```\n\nContributing\n---\n\nFollows [conventional commits](https://www.conventionalcommits.org/).\n\nFor example:\n\n- `feat(Server): something` for server feature.\n\n- `fix(Client): something` for client bug fix.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhans00%2Ffastws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhans00%2Ffastws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhans00%2Ffastws/lists"}