Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/turbomack/hs-websockets-workshop
Intoroduction to websockets in Haskell
https://github.com/turbomack/hs-websockets-workshop
haskell tutorial websockets
Last synced: 25 days ago
JSON representation
Intoroduction to websockets in Haskell
- Host: GitHub
- URL: https://github.com/turbomack/hs-websockets-workshop
- Owner: turboMaCk
- Created: 2021-10-08T13:53:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-14T15:32:57.000Z (over 3 years ago)
- Last Synced: 2024-11-08T10:52:29.699Z (3 months ago)
- Topics: haskell, tutorial, websockets
- Language: Haskell
- Homepage:
- Size: 44.9 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# WebSockets Server in Haskell
Simple example implementation of websockets server in haskell.
1. See [`Main.hs`](app/Main.hs) for instructions
2. Client code already [implemeted](index.html)
3. Nix and Stack ready
4. [Open live app](http://chat.planning-game.com)
5. Check [cheat branch](https://github.com/turboMaCk/hs-websockets-workshop/tree/cheat) for example implementation## Nix
- you can use `cabal` within `nix-shell`
- to enable [direnv](https://direnv.net/) use `echo "use_nix" > .envrc && direnv allow`
- you can use `nix-build` to build project using nix## Stack
- stack based workflow should be working. use `stack --help` to learn how to use it.
## Intro
Today we're building:
- simple steteful websockets based chat room
- no database
- using STM for state
- no wai/warp
- no MTL, tagless final etc. Beginner Haskell
- persistent sessions, multiple connections per session etc.## More resources
- [Jasper's own introduction to websockets](https://jaspervdj.be/websockets/example/server.html)
- [servant-websockets](https://hackage.haskell.org/package/servant-websockets) for Servant projects
- [wai-websockets](https://hackage.haskell.org/package/wai-websockets) for any wai app
- [check hackage](https://hackage.haskell.org/packages/search?terms=websockets) for more