mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-02 23:35:40 -05:00
dynamic allocation of inbounds
This commit is contained in:
@@ -1,15 +1,10 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/v2ray/v2ray-core/common/dice"
|
||||
v2net "github.com/v2ray/v2ray-core/common/net"
|
||||
)
|
||||
|
||||
var (
|
||||
port = int32(30000)
|
||||
)
|
||||
|
||||
func PickPort() v2net.Port {
|
||||
return v2net.Port(atomic.AddInt32(&port, 1))
|
||||
return v2net.Port(30000 + dice.Roll(10000))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user