Code Monkey home page Code Monkey logo

sample_server's Introduction

Sample Web Server

This is a Flask-based web server example, with an endpoint available for testing WebSocket with Socket.IO<https://socket.io/>.

The container image includes a uWSGI as frontend server.

Endpoints

  • /: Redirects to /static/index.html.
  • /static/index.html: A basic Socket.IO application.
  • /socket.io: The endpoint for Socket.IO (WebSocket).

Usage

Docker

Note: There is a known issue in Docker that gives extremely high open files count, some cases can have "unlimited". See unbit/uwsgi#2299, cri-o/cri-o#7703 and moby/moby#38814 for more detail on ulimit settings for containers.

The example below provides a workaround for this problem.

```sh docker run -d -p 0.0.0.0:8080:8080 --ulimit nofile=4096:4096

ghcr.io/jacky9813/sample_server

```

Run directly

`sh git clone https://github.com/jacky9813/sample_server cd sample_server python3 -m venv .venv source .venv/bin/activate pip install -e . flask --app sample_server.app run -h 127.0.0.1 -p 8080 `

sample_server's People

Contributors

jacky9813 avatar

Watchers

 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.