mirror of
https://github.com/yggdrasil-network/yggstack.git
synced 2025-04-28 14:15:07 +03:00
Update tcpproxy.go
sending the client's IP address to the listening socket
This commit is contained in:
parent
f465d71770
commit
572cd61a2d
1 changed files with 1 additions and 0 deletions
|
@ -24,6 +24,7 @@ func tcpProxyFunc(mtu uint64, dst, src net.Conn) error {
|
||||||
func ProxyTCP(mtu uint64, c1, c2 net.Conn) error {
|
func ProxyTCP(mtu uint64, c1, c2 net.Conn) error {
|
||||||
// Start proxying
|
// Start proxying
|
||||||
errCh := make(chan error, 2)
|
errCh := make(chan error, 2)
|
||||||
|
c2.Write([]byte(c1.RemoteAddr().String()))
|
||||||
go func() { errCh <- tcpProxyFunc(mtu, c1, c2) }()
|
go func() { errCh <- tcpProxyFunc(mtu, c1, c2) }()
|
||||||
go func() { errCh <- tcpProxyFunc(mtu, c2, c1) }()
|
go func() { errCh <- tcpProxyFunc(mtu, c2, c1) }()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue