请大哥赐它最后一次测试!
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
"net/url"
|
"net/url"
|
||||||
@@ -621,13 +622,26 @@ func (s *Service) setupNode() error {
|
|||||||
ssOptions := &option.ShadowsocksInboundOptions{
|
ssOptions := &option.ShadowsocksInboundOptions{
|
||||||
ListenOptions: listen,
|
ListenOptions: listen,
|
||||||
Method: method,
|
Method: method,
|
||||||
Managed: true,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.Contains(method, "2022") {
|
isSS2022 := strings.Contains(method, "2022")
|
||||||
// SS2022: server_key is ALREADY Base64 from panel (Double-wrapping fixed)
|
var dummyKey string
|
||||||
|
if isSS2022 {
|
||||||
ssOptions.Password = serverKey
|
ssOptions.Password = serverKey
|
||||||
|
dummyBytes := make([]byte, ss2022KeyLength(method))
|
||||||
|
for i := range dummyBytes {
|
||||||
|
dummyBytes[i] = byte(rand.Intn(256))
|
||||||
|
}
|
||||||
|
dummyKey = base64.StdEncoding.EncodeToString(dummyBytes)
|
||||||
|
} else {
|
||||||
|
dummyKey = "dummy_user_key"
|
||||||
|
}
|
||||||
|
|
||||||
|
ssOptions.Users = []option.ShadowsocksUser{{
|
||||||
|
Password: dummyKey,
|
||||||
|
}}
|
||||||
|
|
||||||
|
if isSS2022 {
|
||||||
s.logger.Info("Xboard SS2022 setup. Method: ", method, " Master_PSK: ", ssOptions.Password)
|
s.logger.Info("Xboard SS2022 setup. Method: ", method, " Master_PSK: ", ssOptions.Password)
|
||||||
} else {
|
} else {
|
||||||
// Legacy SS: password-based
|
// Legacy SS: password-based
|
||||||
|
|||||||
Reference in New Issue
Block a user