Skip to content

Latest commit

 

History

History

websockets

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

WebSockets - Live Demo

This is a minimal example of how to connect to a WebSocket. It connects to wss://echo.websocket.org which just repeats whatever you say.

Demo

The important code lives in src/Main.elm and in index.html with comments!

Building Locally

Run the following commands:

git clone https://github.com/elm-community/js-integration-examples.git
cd js-integration-examples/websockets

elm make src/Main.elm --output=elm.js
open index.html

Some terminals may not have an open command, in which case you should open the index.html file in your browser another way.