Revert "Rollback new routing functionality (#1805)" (#1813)

This reverts commit 9f32ccd453.
This commit is contained in:
Maycon Santos
2024-04-09 01:56:52 +09:00
committed by GitHub
parent 9f32ccd453
commit 3875c29f6b
49 changed files with 2982 additions and 367 deletions

21
util/net/listener.go Normal file
View File

@@ -0,0 +1,21 @@
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
}