Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dfordivam/reflex-yesod-websockets
Toy app to try websockets with reflex and yesod
https://github.com/dfordivam/reflex-yesod-websockets
haskell reflex-frp websocket-client websocket-server websockets yesod
Last synced: 6 days ago
JSON representation
Toy app to try websockets with reflex and yesod
- Host: GitHub
- URL: https://github.com/dfordivam/reflex-yesod-websockets
- Owner: dfordivam
- Created: 2017-03-14T07:44:42.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-15T04:59:42.000Z (almost 8 years ago)
- Last Synced: 2024-12-23T11:13:12.955Z (11 days ago)
- Topics: haskell, reflex-frp, websocket-client, websocket-server, websockets, yesod
- Language: Haskell
- Size: 6.84 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# reflex-yesod-websockets
Do communication between Reflex frontend and Yesod backend using websocket
protocol.This will compile and run the yesod server on port 3000
```
cd backend; stack build; stack exec reflex-yesod-websockets-backend
```For compiling front-end use the script from [reflex-platform][reflex-link]
```
/path/to/reflex-platform/work-on ghcjs ./frontend
cd frontend; cabal configure --ghcjs && cabal build
```Then open the generated [index.html][index-link] in browser.
Note that if you open [localhost:3000](http://localhost:3000) directly in browser then it will use the page from yesod instead, which essentially does the same work as reflex frontend.
Yesod code has been taken from (https://github.com/yesodweb/yesod/blob/master/yesod-websockets/sample.hs)
Reflex code from (https://github.com/reflex-frp/reflex-examples/blob/master/websocket-echo/src/Main.hs)
[reflex-link]: https://github.com/reflex-frp/reflex-platform
[index-link]: frontend/dist/build/reflex-yesod-websockets-frontend/reflex-yesod-websockets-frontend.jsexe/index.html