{"id":17444371,"url":"https://github.com/jameskyburz/aws-lambda-ws-server","last_synced_at":"2025-06-14T05:38:08.142Z","repository":{"id":52413397,"uuid":"164877075","full_name":"JamesKyburz/aws-lambda-ws-server","owner":"JamesKyburz","description":" aws lambda websocket server.","archived":false,"fork":false,"pushed_at":"2021-04-29T21:33:51.000Z","size":137,"stargazers_count":40,"open_issues_count":6,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T12:54:22.802Z","etag":null,"topics":["apigateway","aws","lambda","websocket","ws"],"latest_commit_sha":null,"homepage":"https://npm.im/aws-lambda-ws-server","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/JamesKyburz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-09T14:23:14.000Z","updated_at":"2025-01-14T06:43:07.000Z","dependencies_parsed_at":"2022-08-28T13:00:41.119Z","dependency_job_id":null,"html_url":"https://github.com/JamesKyburz/aws-lambda-ws-server","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesKyburz%2Faws-lambda-ws-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesKyburz%2Faws-lambda-ws-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesKyburz%2Faws-lambda-ws-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesKyburz%2Faws-lambda-ws-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesKyburz","download_url":"https://codeload.github.com/JamesKyburz/aws-lambda-ws-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251667207,"owners_count":21624448,"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":["apigateway","aws","lambda","websocket","ws"],"created_at":"2024-10-17T17:19:42.502Z","updated_at":"2025-04-30T08:23:39.168Z","avatar_url":"https://github.com/JamesKyburz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-lambda-ws-server\n\n\n[![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/feross/standard)\n[![build status](https://api.travis-ci.org/JamesKyburz/aws-lambda-ws-server.svg)](https://travis-ci.org/JamesKyburz/aws-lambda-ws-server)\n[![downloads](https://img.shields.io/npm/dm/aws-lambda-ws-server.svg)](https://npmjs.org/package/aws-lambda-ws-server)\n\n\u003ca href=\"https://asciinema.org/a/291478?autoplay=1\u0026speed=1.5\u0026size=medium\u0026preload=1\"\u003e\u003cimg src=\"https://asciinema.org/a/291478.svg\" width=\"480\"\u003e\u003c/a\u003e\n\nAWS Lambda Websocket Server.\n\n### usage\n\n```javascript\nconst ws = require('aws-lambda-ws-server')\nexports.handler = ws(\n  ws.handler({\n    async connect ({ id }) {\n      console.log('connection %s', id)\n      return { statusCode: 200 }\n    },\n    async disconnect ({ id }) {\n      console.log('disconnect %s', id)\n      return { statusCode: 200 }\n    },\n    async default ({ message, id }) {\n      console.log('default message', message, id)\n      return { statusCode: 200 }\n    },\n    async message ({ message, id, context }) {\n      const { postToConnection } = context\n      console.log('message', message, id)\n      await postToConnection({ message: 'echo' }, id)\n      return { statusCode: 200 }\n    }\n  })\n)\n```\n\nWorks locally and in a lambda function.\n\n# license\n[Apache License, Version 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjameskyburz%2Faws-lambda-ws-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjameskyburz%2Faws-lambda-ws-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjameskyburz%2Faws-lambda-ws-server/lists"}