Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple committed Jul 27, 2024
1 parent a48db81 commit 6f42590
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sshmux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
var sshmuxProxyAddr *net.TCPAddr = localhostTCPAddr(8222)
var sshmuxProxiedAddr *net.TCPAddr = localhostTCPAddr(8122)
var sshmuxServerAddr *net.TCPAddr = localhostTCPAddr(8022)
var sshdProxyAddr *net.TCPAddr = localhostTCPAddr(2332)
var sshdProxiedAddr *net.TCPAddr = localhostTCPAddr(2332)
var sshdServerAddr *net.TCPAddr = localhostTCPAddr(2333)
var apiServerAddr *net.TCPAddr = localhostTCPAddr(5000)

Expand Down Expand Up @@ -58,7 +58,7 @@ func sshAPIHandler(w http.ResponseWriter, r *http.Request) {
PrivateKey: examplePrivate,
}
if enableProxy {
res.Address = sshdProxyAddr.String()
res.Address = sshdProxiedAddr.String()
res.ProxyProtocol = 2
} else {
res.Address = sshdServerAddr.String()
Expand Down Expand Up @@ -106,7 +106,7 @@ func initUpstreamProxyServer() {
if err != nil {
log.Fatal(err)
}
// 3. Forward TCP messages in both ways
// 3. Forward TCP messages in both directions
go func() {
defer sshmux.Close()
io.Copy(sshmux, conn)
Expand All @@ -120,7 +120,7 @@ func initUpstreamProxyServer() {
}

func initDownstreamProxyServer() {
listener, err := net.ListenTCP("tcp", sshdProxyAddr)
listener, err := net.ListenTCP("tcp", sshdProxiedAddr)
if err != nil {
log.Fatal(err)
}
Expand All @@ -145,7 +145,7 @@ func initDownstreamProxyServer() {
if err != nil {
log.Fatal(err)
}
// 2. Forward TCP messages in both ways
// 2. Forward TCP messages in both directions
go func() {
defer sshd.Close()
io.Copy(sshd, conn)
Expand Down

0 comments on commit 6f42590

Please sign in to comment.