mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 15:53:17 +00:00
core: Plugins can register listener networks (#5002)
* core: Plugins can register listener networks This can be useful for custom listeners. This feature/API is experimental and may change! * caddyhttp: Expose server listeners
This commit is contained in:
parent
cb849bd664
commit
1edc1a45e3
2 changed files with 46 additions and 0 deletions
|
@ -579,6 +579,14 @@ func (s *Server) protocol(proto string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// Listeners returns the server's listeners. These are active listeners,
|
||||
// so calling Accept() or Close() on them will probably break things.
|
||||
// They are made available here for read-only purposes (e.g. Addr())
|
||||
// and for type-asserting for purposes where you know what you're doing.
|
||||
//
|
||||
// EXPERIMENTAL: Subject to change or removal.
|
||||
func (s *Server) Listeners() []net.Listener { return s.listeners }
|
||||
|
||||
// ServerLogConfig describes a server's logging configuration. If
|
||||
// enabled without customization, all requests to this server are
|
||||
// logged to the default logger; logger destinations may be
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue