http://golang.org/pkg/net/http/#FileServer
For authorization:
var siteAuth = base64.StdEncoding.EncodeToString([]byte("USERNAME:PASSWORD")) func handle(w http.ResponseWriter, r *http.Request) { auth := r.Header.Get("Authorization") if auth != "Basic "+siteAuth { w.Header().Set("WWW-Authenticate", "Basic realm=\"REALM\"") http.Error(w, "Not Authorized", 401) return } }
http://golang.org/pkg/net/http/#FileServer
For authorization:
No real need for a library.