mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-20 23:19:27 +00:00
tsnet: add Server method to listener
Allow callers to verify that a net.Listener is a tsnet.listener by type asserting against this Server method, as well as providing access to the underlying Server. This is initially being added to support the caddy integration in caddyserver/caddy#5002. Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
@@ -541,6 +541,9 @@ func (ln *listener) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Server returns the tsnet Server associated with the listener.
|
||||
func (ln *listener) Server() *Server { return ln.s }
|
||||
|
||||
type addr struct{ ln *listener }
|
||||
|
||||
func (a addr) Network() string { return a.ln.key.network }
|
||||
|
Reference in New Issue
Block a user