A WebSocket library for Deno


A WebSocket library for Deno.

Although Sockets has working code, it is still very much under development and unstable. APIs will change without notice. Sorry for any inconvenience!


Create your server.

// File: app.ts

import { Server } from "https://deno.land/x/sockets@v0.5.0/mod.ts";

// Create the server
const server = new Server();

// Run the server
  hostname: "",
  port: 1777,

  `Server started on ws://${server.hostname}:${server.port}`,

Run your server.

$ deno run --allow-net app.ts
Server started on ws://

Connect to your server using wscat and send a ping packet.

$ npm install -g wscat
$ wscat -c ws://
> ping
< pong



  • JSON encoding
  • Zero dependencies


Contributors are welcomed!

Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.

Download Details:

Author: drashland

Source Code: https://github.com/drashland/sockets

#deno #nodejs #node #javascript

What is GEEK

Buddha Community

A WebSocket library for Deno



Deno WebSockets Tutorial - WebSockets Setup

In this Deno & WebSockets tutorial we’ll create our websocket connection between the browser & server, then handle those connections on the server using the ws module.

ws module - https://deno.land/std/ws/
uuid module - https://deno.land/std/uuid

🐱‍💻 🐱‍💻 Course Files:

Get denon - https://deno.land/x/denon

#deno #websockets #node #javascript #developer

Micheal  Block

Micheal Block


How to Implement a WebSocket Server and Client with Deno

Get full bidirectional real-time communication for your application by implementing a WebSockets server with Deno.

WebSockets is a communications protocol that allows bidirectional, persistent communication as an alternative to HTTP. Suppose you wanted to get updates to some server state. With HTTP, you would need to poll frequently for the data.

But there are limitations to HTTP polling:

  1. Changes to data aren’t seen in real time by subscribing clients
  2. The server only responds to an initial request from the client — in other words, it’s unidirectional
  3. Server resources are tied up processing requests even when there’s no new data

With WebSockets, clients don’t need to ask the server for new data, the web sockets server simply pushes the new data directly to the client.

When should you use WebSockets?

WebSockets should be used when you need real-time functionality in your application — for example, a chat application or a bot that watches the stock market. WebSockets are best used in situations where you need to react quickly to frequently changing data. If the your application data doesn’t change often, it may be best to implement simple polling logic instead.

How does the WebSockets protocol work?

WebSockets use HTTP as the mechanism to initiate a connection to the server. This connection is then upgraded to a WebSocket connection.

Clients can only access WebSocket servers through a URI scheme of either ws:// or wss://. To initiate a WebSockets connection, you must first implement a WebSocket client and have a supporting WebSockets server. That’s where Deno comes in.

Implementing a WebSocket server and client with Deno

Here’s what we’ll cover in this tutorial:

  1. Creating a WebSocket server in Deno
  2. Creating a WebSocket client in Deno
  3. Sending messages between the server and client
  4. Broadcasting messages from the server to multiple clients

#websocket #deno

Nick  FrankCold

Nick FrankCold


Deno upgrade adds WebSocket API

Deno, an alternative JavaScript runtime to Node.js, has been upgraded with capabilities including a WebSocket API and an early version of an automatic restart capability.

Deno 1.4, released September 13, is being called the largest feature release yet. Highlights include a web standard WebSocket API, for communicating with remote servers via the WebSocket protocol, and an integrated file watcher that can be used to restart any script when its dependencies change. To use the file watcher, developers run a script as they normally would but add the --watch flag. The unstable flag also must be used because this feature is not yet stable.

#deno #javascript #websocket #api

Nick  FrankCold

Nick FrankCold


Deno WebSocket - Real Time Chat system

Create Real-Time Chat System using Deno and WebSocket

Let’s see who is joined or who left

Real-Time Message and Registration system

Check out The Progressive Course of Denojs at


Useful Links:

Docs: https://deno.land/

Source Code: https://github.com/bitfumes/deno-js-w…

#deno #websocket #nodejs




Deno WebSockets Tutorial - Introduction

In this Deno & WebSockets tutorial we’ll disuss what websockets are. How we’ll use them with deno to create a simple web chat room.

🐱‍💻 🐱‍💻 Course Files:

Get denon - https://deno.land/x/denon

#deno #websockets #node #web-development #developer