feat: мультиплексирование звонков (#21)
This commit is contained in:
17 files changed
+1178
-48
No files matched your search
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/samosvalishe/free-turn-proxy/internal/proxy/common"
|
||||
"github.com/samosvalishe/free-turn-proxy/internal/randx"
|
||||
"github.com/samosvalishe/free-turn-proxy/internal/stats"
|
||||
"github.com/samosvalishe/free-turn-proxy/internal/wire/shape"
|
||||
)
|
||||
|
||||
// DTLSLoop поддерживает единственное DTLS-подключение для streamID, перезапуская
|
||||
@@ -236,6 +237,11 @@ func oneTURN(ctx context.Context, deps *Deps, params *Params, peer *net.UDPAddr,
|
||||
relayConn := stream.Relay
|
||||
deps.log().Debugf("[STREAM %d] TURN server IP: %s", streamID, stream.ServerUDPAddr.IP)
|
||||
|
||||
if params.ObfTiming > 0 {
|
||||
relayConn = shape.WrapPacketConn(relayConn, params.ObfTiming)
|
||||
deps.log().Debugf("[STREAM %d] obf-timing=%s", streamID, params.ObfTiming)
|
||||
}
|
||||
|
||||
// Инкремент до ResetErrors - конкурентные наблюдатели HandleAuthError видят
|
||||
// поток подключённым до сброса счётчика ошибок.
|
||||
deps.ConnectedStreams.Add(1)
|
||||
|
||||
@@ -39,6 +39,7 @@ type Params struct {
|
||||
TransportUDP bool
|
||||
Profile string
|
||||
ObfKey []byte
|
||||
ObfTiming time.Duration
|
||||
GetCreds GetCredsFunc
|
||||
ClientID string
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user