Skip to main content

A high-speed, production ready, thread pooled, generic WSGI server with SSL support

Project description

WSGIserver is a high-speed, production ready, thread pooled, generic WSGI server with SSL support.

WSGIserver suppport both Python 2 (2.6 and above) and Python 3 (3.1 and above) and has no dependency.

WSGIserver is developed by Florent Gallaire fgallaire@gmail.com.

Website: http://fgallaire.github.io/wsgiserver.

Download and Install

To install the last stable version from PyPI:

$ sudo pip install wsgiserver

To install the development version from GitHub:

$ git clone https://github.com/fgallaire/wsgiserver
$ cd wsgiserver
$ sudo python setup.py install

Or you can just use the wsgiserver.py file alone, nothing more needed!

Usage

Simplest example on how to use WSGIserver:

import wsgiserver

def my_app(environ, start_response):
    status = '200 OK'
    response_headers = [('Content-type','text/plain')]
    start_response(status, response_headers)
    return ['WSGIserver is running!']

server = wsgiserver.WSGIServer(my_app)
server.start()

Then point your browser to this URL: http://localhost:8080

WSGIserver can serve as many WSGI applications as you want in one instance by using a WSGIPathInfoDispatcher:

d = wsgiserver.WSGIPathInfoDispatcher({'/': my_app, '/blog': my_blog_app})
server = wsgiserver.WSGIServer(d)

To specify an host or a port:

server = wsgiserver.WSGIServer(my_app, host='0.0.0.0', port=8080)

To add SSL support, just specify a certfile and a keyfile:

server = wsgiserver.WSGIServer(my_app, certfile='cert.pem', keyfile='privkey.pem')

Naming

  • WSGIserver is the project name

  • wsgiserver is the Python module name

  • WSGIServer is the main class name

License

WSGIserver files are released under the GNU LGPLv3 or above license.

WSGIserver codebase from CherryPy by CherryPy Team (team@cherrypy.org) under the 3-clause BSD license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

WSGIserver-1.2.tar.gz (40.1 kB view details)

Uploaded Source

Built Distribution

WSGIserver-1.2-py2.py3-none-any.whl (26.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file WSGIserver-1.2.tar.gz.

File metadata

  • Download URL: WSGIserver-1.2.tar.gz
  • Upload date:
  • Size: 40.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for WSGIserver-1.2.tar.gz
Algorithm Hash digest
SHA256 05919f7145b8aeed4502f00a17c7e4520ff5e9aa72415cb8d0accf19a05280f7
MD5 23114524a2214cb453b1967a8710e5a3
BLAKE2b-256 2ca6183fbc5ef100b06f1f105ed04c1a66f1a68806d0d0a89e610502676b8e86

See more details on using hashes here.

File details

Details for the file WSGIserver-1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for WSGIserver-1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cfb6fc8b25d35fe1283e83626ea691c526636ff3f09e756167bc58f5c71ecc85
MD5 103709a947a8ca6404535482896f875e
BLAKE2b-256 d66d137dab6bb6f24037b045a6c4aeab37bcbe3b23130975ef237c33d668bf4c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page