mirror of
https://github.com/fosrl/newt.git
synced 2025-05-13 13:40:39 +01:00
27 lines
548 B
Go
27 lines
548 B
Go
package proxy
|
|
|
|
import (
|
|
"log"
|
|
"net"
|
|
"sync"
|
|
|
|
"golang.zx2c4.com/wireguard/tun/netstack"
|
|
)
|
|
|
|
type ProxyTarget struct {
|
|
Protocol string
|
|
Listen string
|
|
Port int
|
|
Target string
|
|
cancel chan struct{} // Channel to signal shutdown
|
|
listener net.Listener // For TCP
|
|
udpConn net.PacketConn // For UDP
|
|
sync.Mutex // Protect access to connections
|
|
}
|
|
|
|
type ProxyManager struct {
|
|
targets []ProxyTarget
|
|
tnet *netstack.Net
|
|
log *log.Logger
|
|
sync.RWMutex // Protect access to targets slice
|
|
}
|