细化面板REALITY配置

This commit is contained in:
wyx2685 2023-11-18 11:59:58 +09:00
parent 02852ee609
commit 5998358a5d
No known key found for this signature in database
GPG Key ID: 8827A30FF1DB1379
2 changed files with 11 additions and 3 deletions

View File

@ -74,6 +74,7 @@ type VAllssNode struct {
type TlsSettings struct {
ServerName string `json:"server_name"`
Dest string `json:"dest"`
ServerPort string `json:"server_port"`
ShortId string `json:"short_id"`
PrivateKey string `json:"private_key"`

View File

@ -61,7 +61,14 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio
tls.Enabled = true
v := info.VAllss
tls.ServerName = v.TlsSettings.ServerName
dest, _ := strconv.Atoi(v.TlsSettings.ServerPort)
port, _ := strconv.Atoi(v.TlsSettings.ServerPort)
var dest string
if v.TlsSettings.Dest != "" {
dest = v.TlsSettings.Dest
} else {
dest = tls.ServerName
}
mtd, _ := time.ParseDuration(v.RealityConfig.MaxTimeDiff)
tls.Reality = &option.InboundRealityOptions{
Enabled: true,
@ -69,8 +76,8 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio
PrivateKey: v.TlsSettings.PrivateKey,
Handshake: option.InboundRealityHandshakeOptions{
ServerOptions: option.ServerOptions{
Server: tls.ServerName,
ServerPort: uint16(dest),
Server: dest,
ServerPort: uint16(port),
},
},
MaxTimeDifference: option.Duration(mtd),