https://github.com/ixmrm01/websocket
Elm Erlang Websocket
https://github.com/ixmrm01/websocket
cowboy elm erlang websocket
Last synced: about 2 months ago
JSON representation
Elm Erlang Websocket
- Host: GitHub
- URL: https://github.com/ixmrm01/websocket
- Owner: ixmrm01
- Created: 2021-03-29T23:05:40.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-23T18:32:54.000Z (about 5 years ago)
- Last Synced: 2025-04-12T20:56:17.832Z (about 1 year ago)
- Topics: cowboy, elm, erlang, websocket
- Language: Erlang
- Homepage:
- Size: 153 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# websocket
Elm Erlang Websocket
## Setup
```
$ rebar3 new app websocket
```
## Elm
```
$ cd websocket
$ mkdir priv
$ cd priv
$ elm init
$ elm install elm/json
```
Create index.html
Create src/Main.elm
```
$ mkdir static
$ elm make src/Main.elm --optimize --output=static/main.js
```
## Erlang
Modify rebar.config
Modify websocket.app.src
Modify websocket_app.erl
Modify websocket_sup.erl
Create ws_h.erl
```
$ cd ..
$ rebar3 shell
```
## Test
http://localhost:8080
## Learn more
* [Elm Ports](https://guide.elm-lang.org/interop/ports.html)
* [Cowboy Websocket example](https://github.com/ninenines/cowboy/tree/master/examples/websocket)