Giter Club home page Giter Club logo

websocketrelayer's Introduction

WebsocketRelayer

A simple websocket server which relays to all clients written in Python using Flask.

Just connect to the server and any message you sent will be received by all connected clients.

TL;DR

$ git clone https://github.com/hku-ect/WebsocketRelayer.git
Cloning into 'WebsocketRelayer'...
...
$ cd WebsocketRelayer/
$ python3 -m venv mypythondir
$ . mypythondir/bin/activate
$ pip install flask flask-socketio eventlet
Collecting flask
  Using cached https://files.pythonhosted.org/packages/9b/93/628509b8d5dc749656a9641f4caf13540e2cdec85276964ff8f43bbb1d3b/Flask-1.1.1-py2.py3-none-any.whl
...
$ python3 main.py
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 239-841-434
(27896) wsgi starting up on http://0.0.0.0:5000

Installation

You will need the eventlet, flask and flask-socketio dependency, see below. Inside the repository directory run the server:

python3 main.py

Use a virtual environment to customize a Python setup

First create an environment directory in the current directory:

python3 -m venv mypythondir

Then activate the Python environment for your session:

. mypythondir/bin/activate

You can now use pip to install any dependencies you need. For example install Flask with SocketIO:

pip install flask flask-socketio eventlet

websocketrelayer's People

Contributors

sphaero avatar thanvannispen avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.