Skip to content

DenoPlayground/WebSocketServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deno webSocketServer

Simple WebSocket server implemented in Deno.

Usage

Here is an example for a simple WebSocket server that logs the incoming message event.

webSocketServer(
    {
        hostname: 'localhost',
        port: 8080
    },
    (webSocket) => {
        webSocket.addEventListener(
            'message',
            (event) => {
                console.log(`MessageEvent: ${event}`);
            }
        )
    }
)