Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PasarGuard/node
/ FindFreePort
Function
FindFreePort
pkg/netutil/port.go:18–26 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
16
}
17
18
func
FindFreePort() int {
19
var
apiPort int
20
for
apiPort = rand.Intn(50000) + 10000; apiPort < 65536; apiPort++ {
21
if
isPortFree(apiPort) {
22
break
23
}
24
}
25
return
apiPort
26
}
Callers
4
New
Function · 0.92
Disconnect
Method · 0.92
TestXrayBackend
Function · 0.92
TestGetOutboundsLatencyWithRealXray
Function · 0.92
Calls
1
isPortFree
Function · 0.85
Tested by
2
TestXrayBackend
Function · 0.74
TestGetOutboundsLatencyWithRealXray
Function · 0.74