This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.
Code snippet to perform basic auth using go. Every incoming request is required to pass the the username/password combination in the headers and you are expected to validate and return a www-authenticate header response in case of auth failure. 

 hFunc := func(w http.ResponseWriter, r *http.Request) {
 user, pass, ok := r.BasicAuth()
 if !ok {
 fmt.Println("Error parsing basic…
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.