WebSockets

What are WebSockets?

WebSockets are a computer communications protocol that provides a full-duplex communication channel over a single Transmission Control Protocol (TCP) connection. Unlike the traditional HTTP protocol, which is unidirectional and stateless, WebSockets allow for bidirectional communication between a client and a server. more specifically:

  • HTTP: It’s a stateless protocol where each request from the client to the server is independent, and after the server responds, the connection is closed. This means for every new request, a new connection is established.

  • WebSockets: They create a persistent, two-way communication channel. Once the connection is established through a handshake, it remains open, allowing real-time data exchange without the need to repeatedly refresh the page or make new HTTP requests.

Options

I’ve been looking for options on how to integrate this into my project and I found 2 examples online.

Live Chat Example This one is a very backend focused option which relies heavily on my own system but looks to be functional if I can get it to work on my machine without any issues. Image

Mort Game Example This example is from none other than Mr. Mort which is another option I am highly considering if the previous one fails. This one seems to be very frontend focused with what I most likely assume a small backend aspect pertaining to it in order to recieve the messages from the client and display it for everyone.

Goals

The goal of doing this is to get myself to learn more about websockets while doing something that I enjoy which is coding but also creating something that I did myself that I can hopefully share to others to use in the future. One thing I want to do is adopt PLACE as my own project and implement the things I’ve learned over the years into that project and make a useable application. Somtheing that I could possible collaborate with Mr. Mortensen on to potentially bring to the CSA classroom as a place (get it lol) that people can also use to collaborate and communicate with teams.