mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-07 08:44:07 +01:00
3875c29f6b
This reverts commit 9f32ccd453
.
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
|
|
}
|