(l net.Listener, handlers ...func(*http.ServeMux))
| 28 | ) |
| 29 | |
| 30 | func serveHTTP(l net.Listener, handlers ...func(*http.ServeMux)) error { |
| 31 | mux := http.NewServeMux() |
| 32 | for _, h := range handlers { |
| 33 | h(mux) |
| 34 | } |
| 35 | if err := http.Serve(l, mux); err != nil { |
| 36 | return fmt.Errorf("HTTP server shut down: %s", err) |
| 37 | } |
| 38 | return nil |
| 39 | } |
| 40 | |
| 41 | func (s *Server) serveHTTP(mux *http.ServeMux) { |
| 42 | mux.HandleFunc("/_/ipxe", s.handleIpxe) |