Git Product home page Git Product logo

oasis's Introduction

oasis

oasis is a simple HTTP, PROXY, CGI, WSGI server written in pure python.

Status

Build Status

Requirements

  • Python 2.6 - 2.7 (dose not support python 3.x)

How to Install

You want to use latest version, you can use git clone from github.com.

$ git clone https://github.com/yanolab/oasis.git
$ cd oasis
$ sudo python setup.py install

How to use

Run the following command and See the help.

$ python -m oasis.serve -h
usage: python -m oasis.serve [-h] [-v] [-c CONFIGFILE] [-a ADDRESS] [-p PORT]

oasis

optional arguments:
    -h, --help            show this help message and exit
    -v, --verbose         print configuration.
    -c CONFIGFILE, --config CONFIGFILE
                          config file.
    -a ADDRESS, --address ADDRESS
                          server address.
    -p PORT, --port PORT  server port.

Configuration

Configuration is JSON format. Default configuration is there.

{
  "apps":{
    "":[{"route":["/cgi-bin", "/htbin"], "handler":"cgi"},
        {"route":"/wsgi", "handler":"wsgi", "config":{"app":"oasis.wsgi.envdump.application"}},
        {"route":"/", "handler":"localfile"}],
    "*":{"route":"/", "handler":"pipe"}
  },
  "hooks":["processtime", "requestcounter"]
}

You can write the configuration of each domain under the "apps". If domain is empty ('""'), it means 127.0.0.1, and '"*"' means any domain. If you want to use proxy the specification domain, write domain on there.

For example, "www.google.com": {"route":"/", "handler":"localfile"} is proxy from any request for www.google.com porxy to local file.

Handler is the only one on each route. Handlers are localfile(WWW), pipe(PROXY), cgi, wsgi. Global hooks is under "hooks". Each route can have "hook". If you want to use your handler, write your script import path on "handler".

History

  • 2013-5-7 v0.9.0 first release
  • 2013-10-12 v0.9.1 fixed document

oasis's People

Contributors

yanolab avatar

Stargazers

 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.