An expandable Python HTTP server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Fierelier 305e9a4307 Set socket.SO_REUSEADDR, so the server doesn't fail to reboot 3 months ago
index First commit 8 months ago
modules Set socket.SO_REUSEADDR, so the server doesn't fail to reboot 3 months ago
LICENSE Update 'LICENSE' 8 months ago Update '' 8 months ago First commit 8 months ago


An expandable Python HTTP server.

You can find settings for the base-server in modules/, and http-specific settings in modules/http/


.pyp scripts are quite similar to .php, just that they're Python scripts. Each script gets a variable called env, which contains low-level, as well as high-level information about the request. Open to see what they're set to. You can also add query parameters, like this:, these are digested as well. Edit index/test/index.pyp to see how the test page works.

Description of env:

selfA reference to the thread the script belongs to.
requestTimeThe time when the request was received, as a Unix timestamp.
headerThe header text the client sent to the server, including the HTTP request line.
protocolHeaderListRequest line digested into a list.
headerListHeaders digested into a dictionary.
cmdMethod requested (get, post, etc).
pathPath extracted from headerList.
argsQuery parameters digested into a dictionary.
pathFixedPath, stripped of errors/malice.
lPathLocal path, relative to index folder (based on pathFixed).
fPathFull path (based on pathFixed).
fileExtFile extension (based on pathFixed).
fPathDirThe file's folder (based on pathFixed).
requestTimeFormattedRequest time formatted for HTML (based on requestTime).
handlerThe function handling the request.
htaccessPropagateWhether to read further htpyaccess files in sub-directories.