Skip to content

Commit

Permalink
fix scanner ip6 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
uoosef committed Feb 5, 2024
1 parent c36f5bd commit 918ea4e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ replace github.com/Psiphon-Labs/psiphon-tunnel-core => github.com/uoosef/psiphon
require (
github.com/MakeNowJust/heredoc/v2 v2.0.1
github.com/Psiphon-Labs/psiphon-tunnel-core v0.0.0-00010101000000-000000000000
github.com/bepass-org/ipscanner v0.0.0-20240202184838-2a4a13151bb1
github.com/bepass-org/ipscanner v0.0.0-20240205155121-8927b7437d16
github.com/bepass-org/proxy v0.0.0-20240201095508-c86216dd0aea
github.com/go-ini/ini v1.67.0
github.com/refraction-networking/conjure v0.7.10-0.20231110193225-e4749a9dedc9
Expand Down
8 changes: 7 additions & 1 deletion wiresocks/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/go-ini/ini"
"log"
"net"
"strings"
"time"
)

Expand Down Expand Up @@ -85,5 +86,10 @@ func ipToAddress(ip net.IP) string {
} else if err != nil {
panic(err)
}
return fmt.Sprintf("%s:%d", ip.String(), ports[int(b[0])%len(ports)])
serverAddress := fmt.Sprintf("%s:%d", ip.String(), ports[int(b[0])%len(ports)])
if strings.Contains(ip.String(), ":") {
//ip6
serverAddress = fmt.Sprintf("[%s]:%d", ip.String(), ports[int(b[0])%len(ports)])
}
return serverAddress
}

0 comments on commit 918ea4e

Please sign in to comment.