amethystwss / amethyst

The Amethyst WebSocket Server, a complete, specification compliant WebSocket server implementation.

Home Page:https://amethystwss.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contributors Forks Stargazers Issues MIT License


Logo

Amethyst WebSockets

A full-blown, complete, specification compliant WebSocket server.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About Amethyst
  2. Getting Started
  3. Usage
  4. License
  5. Acknowledgements

About Amethyst

Product Name Screen Shot

There are a lot of articles on the Internet that attempt to teach how the WebSocket protocol works, and even how to make a server that accepts WebSocket connections! This is why I decided to make an attempt at writing the best server I possibly could, and keep less experienced people from exposing their entire network to attacks.

Here's why:

  • Security tends not to be at the center of a web developer's attention while developing, and so he/she/they will make some dangerous mistakes during the process.
  • I wanted a WebSocket server that was capable of hosting multiple endpoints at once, with every endpoint being represented in different files throughout a filesystem.
  • There aren't many production-ready WebSocket server applications out there.

Of course, though, since this is an open source project and is therefore open for others to look around, we are grateful for any contributions and/or ideas you may have to bring to the table. You can find more information about contribution to this repository in CONTRIBUTING.md.

A list of resources you can use to learn about WebSockets are listed in the Acknowledgements section.

Built With

Here's the best part. We have no dependencies, and intend to remain that way.

There are plenty of Node.js WebSocket server implementations, including good ones like websockets/ws or socketio/socket.io. The problem is that, due to their simplicity, they don't have much in the way of safely controlling WebSocket connections, for example, for limiting payload size. This isn't even beginning to mention the lack of dynamically loading individual endpoint scripts.

Additionally, the reason we stick with a "no dependencies" philosophy, is because we want this package to be as easy to install and use as possible. Relying on other packages to do the bulk of the work for us just won't cut it when it comes to having to install all of those extra dependencies on a brand new system.

Getting Started

To start into the world of WebSocket servers, follow these steps to install a copy of Amethyst on your Debian/Ubuntu Linux system.

Installation

  1. Download the installation script
    curl https://raw.githubusercontent.com/amethystwss/amethyst/main/install.sh >> install_amethyst.sh
  2. Run the script to install the package (root access is required)
    sudo bash install_amethyst.sh

Starting the Service

The software comes with an echo service available out-of-the-box to test with, so we should get to trying it out!

  1. Start the Service
    sudo amethystctl start
  2. Test it using whatever service you want! The endpoint should be available at http(s)://localhost:<port>/echo.

SECURITY WARNING

You should set this software up with caution, since testing it locally first is the best course of action. An improperly set up server, i.e. not behind a good firewall+HTTP proxy, that is available to the public is a risk to the integrity of your system and local network.

License

Distributed under the Apache-2.0 License. See LICENSE for more information.

Acknowledgements

About

The Amethyst WebSocket Server, a complete, specification compliant WebSocket server implementation.

https://amethystwss.github.io

License:Apache License 2.0


Languages

Language:JavaScript 100.0%