Fix: stack overflow

This commit is contained in:
kayos@tcp.direct 2023-01-31 01:26:11 -08:00
parent 7ade879676
commit 5d9bdc3896
Signed by: kayos
GPG Key ID: 4B841471B4BEE979

View File

@ -53,7 +53,7 @@ type ProxyChannels struct {
// Slice returns a slice of all proxyLists in ProxyChannels, note that HTTP is not included.
func (pc ProxyChannels) Slice() []*proxyList {
lists := []*proxyList{&pc.SOCKS5, &pc.SOCKS4, &pc.SOCKS4a}
entropy.GetOptimizedRand().Shuffle(len(pc.Slice()), func(i, j int) {
entropy.GetOptimizedRand().Shuffle(3, func(i, j int) {
lists[i], lists[j] = lists[j], lists[i]
})
return lists