Skip to content

thgh/websocket-room

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

websocket-room

This websocket server will broadcast all messages it receives to sockets connected to the same URL.

Client-side, you can connect with new WebSocket(url), or use the wrapper in public/connectable.js that will try to reconnect.

// Connect to `room-name`
const socket = connectable('ws://localhost:8080/room-name')

// Log all messages in `room-name`
socket.subscribe(console.log)

// Send a chat message
form.onsubmit = () => socket.send(nameInput.value)

About

Alternative to websocket.in

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published