mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 18:08:14 -05:00
细化面板REALITY配置
This commit is contained in:
parent
02852ee609
commit
5998358a5d
@ -74,6 +74,7 @@ type VAllssNode struct {
|
|||||||
|
|
||||||
type TlsSettings struct {
|
type TlsSettings struct {
|
||||||
ServerName string `json:"server_name"`
|
ServerName string `json:"server_name"`
|
||||||
|
Dest string `json:"dest"`
|
||||||
ServerPort string `json:"server_port"`
|
ServerPort string `json:"server_port"`
|
||||||
ShortId string `json:"short_id"`
|
ShortId string `json:"short_id"`
|
||||||
PrivateKey string `json:"private_key"`
|
PrivateKey string `json:"private_key"`
|
||||||
|
@ -61,7 +61,14 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio
|
|||||||
tls.Enabled = true
|
tls.Enabled = true
|
||||||
v := info.VAllss
|
v := info.VAllss
|
||||||
tls.ServerName = v.TlsSettings.ServerName
|
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)
|
mtd, _ := time.ParseDuration(v.RealityConfig.MaxTimeDiff)
|
||||||
tls.Reality = &option.InboundRealityOptions{
|
tls.Reality = &option.InboundRealityOptions{
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
@ -69,8 +76,8 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio
|
|||||||
PrivateKey: v.TlsSettings.PrivateKey,
|
PrivateKey: v.TlsSettings.PrivateKey,
|
||||||
Handshake: option.InboundRealityHandshakeOptions{
|
Handshake: option.InboundRealityHandshakeOptions{
|
||||||
ServerOptions: option.ServerOptions{
|
ServerOptions: option.ServerOptions{
|
||||||
Server: tls.ServerName,
|
Server: dest,
|
||||||
ServerPort: uint16(dest),
|
ServerPort: uint16(port),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
MaxTimeDifference: option.Duration(mtd),
|
MaxTimeDifference: option.Duration(mtd),
|
||||||
|
Loading…
Reference in New Issue
Block a user