diff --git a/remote.go b/remote.go index 2d1847c..7c5ede9 100644 --- a/remote.go +++ b/remote.go @@ -394,11 +394,16 @@ func (r *RemoteCli) Serve() error { return nil } -func ListenRemote(n, addr string, cfg *Config, h func(*Instance)) error { +func ListenRemote(n, addr string, cfg *Config, h func(*Instance), onListen ...func(net.Listener) error) error { ln, err := net.Listen(n, addr) if err != nil { return err } + if len(onListen) > 0 { + if err := onListen[0](ln); err != nil { + return err + } + } for { conn, err := ln.Accept() if err != nil {