Skip to content

apiorno/ws_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ws_server

Erlang websocket server using Cowboy library.

Build & start

$ rebar3 shell

Testing

To open a client connection, from a web browser execute:

    (()=>{
    window.a = new WebSocket("ws://localhost:8080/ws?num=3");
    a.onopen = event => console.log("socket opened");
    a.onclose = event => console.log("socket closed");
    a.onmessage = event => console.log("message received from server: "+event.data);
    })();

Then execute:

    a.send(5);

Finally, you can close the connection from the server or from the client executing:

    a.close();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages