Addr returns the address the server is listening on. This is useful when the server was started with port 0.
()
| 486 | // Addr returns the address the server is listening on. |
| 487 | // This is useful when the server was started with port 0. |
| 488 | func (s *Server) Addr() string { |
| 489 | if s.listener == nil { |
| 490 | return "" |
| 491 | } |
| 492 | return s.listener.Addr().String() |
| 493 | } |
| 494 | |
| 495 | // IsTLSListener reports whether the proxy listener is serving TLS. |
| 496 | func (s *Server) IsTLSListener() bool { |