Skip to content

wh1plash/websocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Example how to use websockets

Server runs on port 4001

To connect from Chrome, you need to run the following commands through the console

let socket = new WebSocket("ws://localhost:4001/order")
socket.onmessage = (event) => {console.log("received from the server: ", event.data)}

simple example of broadcasting message

let socket = new WebSocket("ws://localhost:4001/ws")
socket.send("hi")

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages