Python Webserver

Example of Regular HTTP Static Web Server

Python 3.x

Both port and bind address are optional. For more details, please read the official docs.

Python 2.x

Python 2.x can only accept port as a parameter Bind address parameter is not available.Python 2.x Docs.

In both cases contents of the current folder will be accessible via http://127.0.0.1:8000

Example with SSL Support

To run secure HTTPs server create a following module:

Python 3.x

Python 2.x

To generate key and cert files with OpenSSL use following command