srvwd is a web server that serves the current working directory.
None. srvwd uses only components in the Go standard library.
srvwd has been tested on the following operating systems:
- OpenBSD (5.2)
- OS X (10.8)
go install will install the binary to the ${GOROOT}/bin directory.
srvwd [-c cert] [-k key] [-l listeners] [-p port] [-r] [-u user] [-v] dir
-r will cause srvwd to chroot to the current working directory for security.
If a certificate and keyfile are specified, srvwd will run in TLS
mode.
Use ^C to halt srvwd.
From chroot(2):
This call is restricted to the super-user.
srvwd uses root privileges to chroot to the target directory, then immediately
drops privileges.
setgrp isn't implemented here, as no good solution exists in Go.
The Go version is descended from the original C version.