mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-06 21:04:41 +08:00
Allow for UDP servers (#935)
* Allow for UDP servers Extend the Server interface with ServePacket and ListenPacket - this is in the same vein as the net package. Plumb the packetconn through the start and restart phases. Rename RestartPair to RestartTriple as it now also contains a Packet. Not that these can now be nil, so we need to check for that when restarting. * Update the documentation
This commit is contained in:
@ -82,10 +82,11 @@ func ValidDirectives(serverType string) []string {
|
||||
return stype.Directives
|
||||
}
|
||||
|
||||
// serverListener pairs a server to its listener.
|
||||
// serverListener pairs a server to its listener and/or packetconn.
|
||||
type serverListener struct {
|
||||
server Server
|
||||
listener net.Listener
|
||||
packet net.PacketConn
|
||||
}
|
||||
|
||||
// Context is a type which carries a server type through
|
||||
|
Reference in New Issue
Block a user