DEV Community

12 4

Deno WebSocket Simplified in 2 hours

Create Deno Real Time Chat in a very simple way

Create Real-Time Chat System using #Deno #WebSocket
Let's see who is joined or who left
Real-Time Message and Registration system

Join Deno Progressive Course https://bit.ly/deno-course
Let's discuss more on twitter, follow me http://twitter.com/Sarthaksavvy

Uniqueness of this course

1 Using vanilla Javascript
2 HTTP server and WebSocket server on same port (localhost:8080)
3 Refactoring code to make it managable
4 Extreamly easy way of explaining concepts

How this tutorial is different

There are many blog post and tutorials out there for #deno websocket real time chat system

But this is a simple video of about 2 hours and explained each and every bit of websocket in full details.

So even if you don't know websocket, you will become confident on this.

Module Used

  1. WebSocket module https://deno.land/std/ws
  2. Http Server Module https://deno.land/std/http

What if you want to use WebSocket with oak framework of deno

Here is a progressive course on Deno https://bit.ly/deno-course , where

  1. we will create WebSocket using OAK framework
  2. using vuejs to handle frontend part
  3. storing chat data into mongodb database
  4. using registered user only to enter chat room

dev.to people get a discount of 30% using coupon DENO-DEV.TO-30

Here is the list of topic we will cover in this tutorial

  1. Intro to websocket
  2. Setup WebSockets
  3. Close WebSocket Connection
  4. Getting Data from WebSocket
  5. Talk to Different Websocket
  6. Broadcast to others only
  7. Handle Http Connections
  8. http and ws on same route
  9. Send Event from html file
  10. Send Json in event
  11. Register with name
  12. Create Join Event
  13. Show Joined User
  14. Show all Online Users
  15. Create User leave event
  16. Remove leaved user
  17. Handle Closed Connection
  18. Refactor Main file
  19. Display User Name
  20. Real Time Chat
  21. Message From You

I hope this will help you to get started with Deno
Any suggestions or comments are most welcome.

The Fastest, Most Accurate API for Voice AI

Ad Image

Building an AI Agent that needs to deliver human-like conversations? | Speechmaticsโ€™ real-time ASR is available in 50 languages and can understand speech in a fraction of a second.

Try Free

Top comments (0)

Auth0

Easy to implement, endless possibilities

With a few lines of code, you can have Auth0 by Okta integrated in any app written in any language and any framework. ๐Ÿš€ Start building for free today.

Sign up now

๐Ÿ‘‹ Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Communityโ€”every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple โ€œthank youโ€ goes a long wayโ€”express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay