@@ -139,7 +139,7 @@ func (na NetworkAddress) Listen(ctx context.Context, portOffset uint, config net
139
139
}
140
140
141
141
// check to see if plugin provides listener
142
- if ln , err := getListenerFromPlugin (ctx , na .Network , na .JoinHostPort ( portOffset ) , config ); ln != nil || err != nil {
142
+ if ln , err := getListenerFromPlugin (ctx , na .Network , na .Host , na . port (), portOffset , config ); ln != nil || err != nil {
143
143
return ln , err
144
144
}
145
145
@@ -658,11 +658,11 @@ var unixSocketsMu sync.Mutex
658
658
// getListenerFromPlugin returns a listener on the given network and address
659
659
// if a plugin has registered the network name. It may return (nil, nil) if
660
660
// no plugin can provide a listener.
661
- func getListenerFromPlugin (ctx context.Context , network , addr string , config net.ListenConfig ) (any , error ) {
661
+ func getListenerFromPlugin (ctx context.Context , network , host , port string , portOffset uint , config net.ListenConfig ) (any , error ) {
662
662
// get listener from plugin if network type is registered
663
663
if getListener , ok := networkTypes [network ]; ok {
664
664
Log ().Debug ("getting listener from plugin" , zap .String ("network" , network ))
665
- return getListener (ctx , network , addr , config )
665
+ return getListener (ctx , network , host , port , portOffset , config )
666
666
}
667
667
668
668
return nil , nil
@@ -676,7 +676,7 @@ func listenerKey(network, addr string) string {
676
676
// The listeners must be capable of overlapping: with Caddy, new configs are loaded
677
677
// before old ones are unloaded, so listeners may overlap briefly if the configs
678
678
// both need the same listener. EXPERIMENTAL and subject to change.
679
- type ListenerFunc func (ctx context.Context , network , addr string , cfg net.ListenConfig ) (any , error )
679
+ type ListenerFunc func (ctx context.Context , network , host , portRange string , portOffset uint , cfg net.ListenConfig ) (any , error )
680
680
681
681
var networkTypes = map [string ]ListenerFunc {}
682
682
0 commit comments