Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
faster version of python's SimpleHTTPServer
Go
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
INSTALL
README
srvdir.go

README

srvdir server the current directory via HTTP.

Example of use:

    % ls
    index.html
    post.html
    style.css
    % srvdir -http=:8080

This will serve the files index.html, post.html and style.css in the port 8080,
so you can point your browser to the url http://localhost:8080/post.html and see
the post.html file contents.

It's similar to Python's SimpleHTTPServer, but faster.

Some very basic ab statistics:

Python's SimpleHTTPServer:

    % ab -c 10 -n 5000 http://localhost:8000/post.html
    ...
    Requests per second:    1168.66 [#/sec] (mean)
    Time per request:       8.557 [ms] (mean)
    Time per request:       0.856 [ms] (mean, across all concurrent requests)
    Transfer rate:          5419.88 [Kbytes/sec] received

srvdir:

    % ab -c 10 -n 5000 http://localhost:9090/post.html
    ...
    Requests per second:    4095.31 [#/sec] (mean)
    Time per request:       2.442 [ms] (mean)
    Time per request:       0.244 [ms] (mean, across all concurrent requests)
    Transfer rate:          18992.80 [Kbytes/sec] received
Something went wrong with that request. Please try again.