We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 230f714 commit 3e703aeCopy full SHA for 3e703ae
share/tunnel/tunnel_in_proxy.go
@@ -4,6 +4,7 @@ import (
4
"context"
5
"io"
6
"net"
7
+ "sync"
8
9
"github.com/jpillora/chisel/share/cio"
10
"github.com/jpillora/chisel/share/settings"
@@ -26,6 +27,7 @@ type Proxy struct {
26
27
dialer net.Dialer
28
tcp *net.TCPListener
29
udp *udpListener
30
+ mu sync.Mutex
31
}
32
33
//NewProxy creates a Proxy
@@ -122,8 +124,12 @@ func (p *Proxy) runTCP(ctx context.Context) error {
122
124
123
125
func (p *Proxy) pipeRemote(ctx context.Context, src io.ReadWriteCloser) {
126
defer src.Close()
127
+
128
+ p.mu.Lock()
129
p.count++
130
cid := p.count
131
+ p.mu.Unlock()
132
133
l := p.Fork("conn#%d", cid)
134
l.Debugf("Open")
135
sshConn := p.sshTun.getSSH(ctx)
0 commit comments