mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-01 20:43:43 +01:00
22 lines
476 B
Go
22 lines
476 B
Go
|
package net
|
||
|
|
||
|
import (
|
||
|
"net"
|
||
|
)
|
||
|
|
||
|
// ListenerConfig extends the standard net.ListenConfig with the ability to execute hooks before
|
||
|
// responding via the socket and after closing. This can be used to bypass the VPN for listeners.
|
||
|
type ListenerConfig struct {
|
||
|
*net.ListenConfig
|
||
|
}
|
||
|
|
||
|
// NewListener creates a new ListenerConfig instance.
|
||
|
func NewListener() *ListenerConfig {
|
||
|
listener := &ListenerConfig{
|
||
|
ListenConfig: &net.ListenConfig{},
|
||
|
}
|
||
|
listener.init()
|
||
|
|
||
|
return listener
|
||
|
}
|