/WebSocketsSample

A simple websockets app using FastAPI.

Primary LanguagePythonMIT LicenseMIT

WebSockets Sample App

WebSocketsSample is an app intended to demonstrate how websockets work, use as a starting point for a new websockets app, or help one learn more about websockets. This implementation uses the FastAPI framework as it is replacing Flask. My goal with the project was to learn more about FastAPI, ASGI, uvicorn, and websockets. The websockets code is based on the FastAPI Docs. This code is not intended for production use.

ToDo:

  • Add real websockets client frontend with React, Angular, or X
  • Research application security implications with websockets

Getting Started

Prerequisites

Make sure you have Docker and Python 3.x installed

Clone the repo

git@github.com:dRy3vd/WebSocketsSample.git

Build the container image

docker build -t wssimage .
  • Run the container:
docker run -d --name wsscontainer -p 8000:80 wssimage

You should now be able to access the application: http://localhost:8000

Running with wireshark

In use: In Use

Wireshark 1: wireshark1

Wireshark 2: wireshark2

License

This project is licensed under the terms of the MIT license.