You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
297 B
Go
21 lines
297 B
Go
8 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"io"
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
type server struct {
|
||
|
out io.Writer
|
||
|
errors io.Writer
|
||
|
}
|
||
|
|
||
|
func (s *server) logReceived(r *http.Request) {
|
||
|
fmt.Fprintf(s.out, "> %s\n", r.URL.String())
|
||
|
}
|
||
|
|
||
|
func (s *server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||
|
s.logReceived(r)
|
||
|
}
|