{"id":17992811,"url":"https://github.com/leostera/ws","last_synced_at":"2025-04-04T04:45:53.003Z","repository":{"id":42408854,"uuid":"61873457","full_name":"leostera/ws","owner":"leostera","description":":arrows_counterclockwise: An erlang WebSocket server","archived":false,"fork":false,"pushed_at":"2016-07-09T10:47:31.000Z","size":711,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T16:16:33.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leostera.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":"2016-06-24T09:28:32.000Z","updated_at":"2016-10-24T21:54:22.000Z","dependencies_parsed_at":"2022-09-01T01:01:18.548Z","dependency_job_id":null,"html_url":"https://github.com/leostera/ws","commit_stats":null,"previous_names":["leostera/ws"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leostera%2Fws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leostera%2Fws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leostera%2Fws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leostera%2Fws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leostera","download_url":"https://codeload.github.com/leostera/ws/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247123099,"owners_count":20887259,"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":"2024-10-29T20:09:18.959Z","updated_at":"2025-04-04T04:45:52.983Z","avatar_url":"https://github.com/leostera.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ws [![Travis-CI](https://api.travis-ci.org/ostera/ws.svg)](https://travis-ci.org/ostera/ws)\n\u003e 🔄 An erlang WebSocket server\n\n## Installation\n\nSimply include in your `rebar.config` as:\n\n```erlang\n{deps, [\n  % ...\n  {ws, {git, \"https://github.com/ostera/ws\", {tag, \"0.1.0\"}}}\n  % ...\n]}.\n```\n\n## Tentative Interface\n\n```erlang\nEshell V7.3  (abort with ^G)\n1\u003e {ok, Server} = ws:listen(Options).\nok\n2\u003e ws:on(Server, '_', fun(Data) -\u003e io:format(\"~p\", [Data]) end ).\nok\n\n%% on another shell\nEshell V7.3  (abort with ^G)\n1\u003e {ok, Client, Server} = ws:open(URL).\nok\n2\u003e ws:send(Server, \"Hey there\").\nok\n3\u003e ws:on(Client, '_', fun(Data) -\u003e io:format(\"~p\", [Data]) end).\nok\n\n%% back to shell 1\n3\u003e\nHey there\n3\u003e ws:connections().\n[ \u003c0.103.0\u003e ].\n\n%% on yet another shell\nEshell V7.3  (abort with ^G)\n1\u003e {ok, Client} = ws:open(URL).\nok\n2\u003e ws:on(Client, '_', fun(Data) -\u003e io:format(\"~p\", [Data]) end).\nok\n\n%% back to shell 1\n3\u003e ws:connections().\n[ \u003c0.103.0\u003e, \u003c0.108.0\u003e ].\n4\u003e [ ws:send(C, \"Hello backatcha\") || C \u003c- ws:connections() ].\n[ ok, ok ].\n\n%% shell 2\n4\u003e\nHello backatcha\n\n%% shell 3\n3\u003e\nHello backatcha\n3\u003e ws:close(Client).\nok\n\n%% back to shell 1\n3\u003e ws:connections().\n[ \u003c0.103.0\u003e ].\n```\n\n## Motivation\n\nAs of this writing, there's a plethora of web servers (and more) out there: Webmachine, Mochiweb, Cowboy, N2O, Nitrogen,\nChicagoBoss, Zootonic, Elli.\n\nNone of them provide a fully thought of websockets server as a commodity, but instead you have to build around things like:\n\n1. Connection tracking\n2. Broadcasting/Fanout\n3. Channels/Rooms\n\nAnd if you have to build it, you have to test it, and you have to spend time on it.\n\nI don't want to do that over and over again. Hopefully neither do you.\n\n## Contributing\n\nFork, make a topic branch, and send a Pull Request. Travis will let you know if\nit's good to go, and from the on we can review, retouch, and merge.\n\nIncluded here is a `Makefile` with handy targets. Run `make` to execute the complete\nbattery of tests.\n\n## Next Steps\n\nSee the [issues page](https://github.com/ostera/ws/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement) for a list of planned enhancements and features.\n\n## License\n\nSee [LICENSE](https://github.com/ostera/ws/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleostera%2Fws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleostera%2Fws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleostera%2Fws/lists"}