fix(server): encode server key in base64 for shadowsocks protocol
This commit is contained in:
parent
565eb8cbbf
commit
76063bc071
@ -1,6 +1,7 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/base64"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
@ -61,6 +62,13 @@ func (l *GetServerConfigLogic) GetServerConfig(req *types.GetServerConfigRequest
|
|||||||
l.Errorw("[GetServerConfig] json unmarshal error", logger.Field("error", err.Error()))
|
l.Errorw("[GetServerConfig] json unmarshal error", logger.Field("error", err.Error()))
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if nodeInfo.Protocol == "shadowsocks" {
|
||||||
|
if value, ok := cfg["server_key"]; ok && value != "" {
|
||||||
|
cfg["server_key"] = base64.StdEncoding.EncodeToString([]byte(value.(string)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
resp = &types.GetServerConfigResponse{
|
resp = &types.GetServerConfigResponse{
|
||||||
Basic: types.ServerBasic{
|
Basic: types.ServerBasic{
|
||||||
PullInterval: l.svcCtx.Config.Node.NodePullInterval,
|
PullInterval: l.svcCtx.Config.Node.NodePullInterval,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user