weisrc / rooms

Basic Deno WebSocket server for WebRTC signaling or simply "P2P" communication.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rooms

Basic Deno WebSocket server for WebRTC signaling or simply "P2P" communication.

image

Or use wss://rooms.deno.dev

Usage

const roomId = "my room id"
const ws = new WebSocket("wss://rooms.deno.dev/" + roomId);
// broadcast message to all peers in the room except the sender.
ws.send("Hello world")
// receive broadcasts
ws.onmessage = console.log

It is possible to not add a room ID, but it is not suggested.

  • This can be used for WebRTC signaling without a server.
  • Simple room chat.

Rate Limiting

Right now, there are no rate limiting policies. However...

DO NOT

  • D.O.S.
  • Or do anything stupid...
  • Send lots of data. (use WebRTC)

Avoid

  • Using this in production. (I might shut it down)

Limitations (Deno Deploy)

  • May not receive broadcasts from different regions of the world. (Will soon use the BroadcastChannel API of Deno Deploy to fix this.)

License

MIT

About

Basic Deno WebSocket server for WebRTC signaling or simply "P2P" communication.

License:MIT License


Languages

Language:TypeScript 100.0%