Git Product home page Git Product logo

fwss's Introduction

Setup

  1. Get a web server

    It is assumed that the fwss websocket server will be proxied by a publicly exposed web server such as nginx. Here is a snippet from an nginx coniguration file that demonstrates how to setup nginx to proxy web traffic to the fwss websocket server. Note that we configure nginx to pass the upgrade Http header to fwss so that it can properly negotiate upgrading to the WebSocket protocol from a normal HTTP connection.

     location /wss/ {
        proxy_pass http://127.0.0.1:8888;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
     }

In the above configuration we tell nginx to proxy request URLs that end in /wss/ to the 127.0.0.1 IP address (loop back) on port 8888. The steps below contain information on how to install fwss as a server running at this IP port.

  1. Clone fwss

    The following commands are illustrative of downloading the fwss from github and create a distribution package. The distribution package will create a file archive that can be loaded to your server environment.

    cd ~
    github clone fwss  
    python3.9 setup.py sdist
    

    The above commands are explained one by one below:

    cd ~ -> Connect to the home directory on the machine that you will be downloading the fwss source code to.

    github clone fwss -> This command will create a directory named fwss and download the code from github to this directory.

    python3 setup.py sdist -> This command will run setup.py which will create a distribution package which is an archive file containing the source code for fwss along with all the necessary libraries. Note that any python version later than 3.6 should work. Type python3 --version on your system to see what version of Python 3 is installed.

  2. Install on your web server

    • Create a directory on the webserver (e.g. mkdir ~/fwss_instance_1) - this is where your fwss powered web socket server code will reside.
    • Create a virtual environment - Python3.9
    • pip install ../fwss/dist/fwss-0.1.tar.gz
  3. Configure fwss

    Edit config.py and setup your local environment by specifying such things as the IP address of your server.

fwss's People

Contributors

ferguman avatar

Watchers

 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.