|
|
|
@ -91,13 +91,6 @@ func ErrorEncoder(en EncodeErrorFunc) ServerOption { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Endpoint with server endpoint.
|
|
|
|
|
func Endpoint(endpoint *url.URL) ServerOption { |
|
|
|
|
return func(o *Server) { |
|
|
|
|
o.endpoint = endpoint |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TLSConfig with TLS config.
|
|
|
|
|
func TLSConfig(c *tls.Config) ServerOption { |
|
|
|
|
return func(o *Server) { |
|
|
|
@ -227,9 +220,6 @@ func (s *Server) filter() mux.MiddlewareFunc { |
|
|
|
|
// http://127.0.0.1:8000?isSecure=false
|
|
|
|
|
func (s *Server) Endpoint() (*url.URL, error) { |
|
|
|
|
s.once.Do(func() { |
|
|
|
|
if s.endpoint != nil { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
lis, err := net.Listen(s.network, s.address) |
|
|
|
|
if err != nil { |
|
|
|
|
s.err = err |
|
|
|
|