Update On Fri Jul 5 20:32:55 CEST 2024

This commit is contained in:
github-action[bot]
2024-07-05 20:32:56 +02:00
parent dd39853956
commit 06deae9882
100 changed files with 2497 additions and 955 deletions

View File

@@ -87,6 +87,11 @@ func (b *baseTransporter) RelayTCPConn(c net.Conn, handshakeF TCPHandShakeF) err
}
}
// rate limit
if b.cfg.MaxReadRateKbps > 0 {
c = conn.NewRateLimitedConn(c, b.cfg.MaxReadRateKbps)
}
clonedRemote := remote.Clone()
rc, err := handshakeF(clonedRemote)
if err != nil {
@@ -94,11 +99,6 @@ func (b *baseTransporter) RelayTCPConn(c net.Conn, handshakeF TCPHandShakeF) err
}
defer rc.Close()
// rate limit
if b.cfg.MaxReadRateKbps > 0 {
c = conn.NewRateLimitedConn(c, b.cfg.MaxReadRateKbps)
}
b.l.Infof("RelayTCPConn from %s to %s", c.LocalAddr(), remote.Address)
relayConn := conn.NewRelayConn(
b.cfg.Label, c, rc, conn.WithHandshakeDuration(clonedRemote.HandShakeDuration))

View File

@@ -59,8 +59,7 @@ func (raw *RawClient) HealthCheck(ctx context.Context, remote *lb.Node) error {
type RawServer struct {
*baseTransporter
localTCPAddr *net.TCPAddr
lis *net.TCPListener
lis *net.TCPListener
}
func newRawServer(base *baseTransporter) (*RawServer, error) {
@@ -75,7 +74,6 @@ func newRawServer(base *baseTransporter) (*RawServer, error) {
return &RawServer{
lis: lis,
baseTransporter: base,
localTCPAddr: addr,
}, nil
}