Last Updated: February 25, 2016
·
1.006K
· arifwn

Easily Serve a Directory via HTTP (with concurrency support)

You can use Python's SimpleHTTPServer module to serve a directory via HTTP, but you must keep in mind that it can only support one connection at a time. This can annoying if you intent to serve several big files and download them simultaneously. Fortunately, we have Twisted to the rescue!

twistd -n web --path=./

You can then proceed to access the HTTP server on port 8080. The server support multiple concurrent connection, enabling you (and your friends/coworkers) to download multiple big files concurrently.

You need Python 2.x and Twisted installed in order to use this command.

Picture