From 3b42b3f9c829f886e8a8754d654718c40cd0c260 Mon Sep 17 00:00:00 2001 From: notsure2 Date: Sat, 17 Feb 2024 17:11:01 +0200 Subject: [PATCH] Use the buffer controls also for the redir dialer. --- internal/server/state.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/server/state.go b/internal/server/state.go index 62a1121..e290a5f 100644 --- a/internal/server/state.go +++ b/internal/server/state.go @@ -138,11 +138,10 @@ func ParseConfig(conf string) (raw RawConfig, err error) { // InitState process the RawConfig and initialises a server State accordingly func InitState(preParse RawConfig, worldState common.WorldState) (sta *State, err error) { sta = &State{ - BypassUID: make(map[[16]byte]struct{}), - ProxyBook: map[string]net.Addr{}, - UsedRandom: map[[32]byte]int64{}, - RedirDialer: &net.Dialer{}, - WorldState: worldState, + BypassUID: make(map[[16]byte]struct{}), + ProxyBook: map[string]net.Addr{}, + UsedRandom: map[[32]byte]int64{}, + WorldState: worldState, } if preParse.CncMode { err = errors.New("command & control mode not implemented") @@ -196,6 +195,8 @@ func InitState(preParse RawConfig, worldState common.WorldState) (sta *State, er }) } + sta.RedirDialer = &net.Dialer{Control: dialerControl} + if preParse.KeepAlive <= 0 { sta.ProxyDialer = &net.Dialer{KeepAlive: -1, Control: dialerControl} } else {