testServer is a simple HTTP server that displays the passed headers in the html.
(addr string)
| 55 | |
| 56 | // testServer is a simple HTTP server that displays the passed headers in the html. |
| 57 | func testServer(addr string) error { |
| 58 | mux := http.NewServeMux() |
| 59 | mux.HandleFunc("/", func(res http.ResponseWriter, _ *http.Request) { |
| 60 | fmt.Fprint(res, indexHTML) |
| 61 | }) |
| 62 | return http.ListenAndServe(addr, mux) |
| 63 | } |
| 64 | |
| 65 | const indexHTML = `<!doctype html> |
| 66 | <html> |