Hacker News new | past | comments | ask | show | jobs | submit login

For the file server use the built in FileServer:

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
	}
    }
No real need for a library.



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: