From 572cd61a2d5902f00bd4165be927ed9e43178913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=9F=E3=81=A0=E3=81=AB=E3=82=83=E3=82=93?= <87938588+jus7nyan@users.noreply.github.com> Date: Mon, 22 Jan 2024 00:48:04 +0400 Subject: [PATCH] Update tcpproxy.go sending the client's IP address to the listening socket --- src/types/tcpproxy.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types/tcpproxy.go b/src/types/tcpproxy.go index 6696a2b..07e1ce9 100644 --- a/src/types/tcpproxy.go +++ b/src/types/tcpproxy.go @@ -24,6 +24,7 @@ func tcpProxyFunc(mtu uint64, dst, src net.Conn) error { func ProxyTCP(mtu uint64, c1, c2 net.Conn) error { // Start proxying errCh := make(chan error, 2) + c2.Write([]byte(c1.RemoteAddr().String())) go func() { errCh <- tcpProxyFunc(mtu, c1, c2) }() go func() { errCh <- tcpProxyFunc(mtu, c2, c1) }()