mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 09:58:14 -05:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
f0ad893d9a
@ -6,6 +6,7 @@ import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/Yuzuki616/V2bX/api/panel"
|
||||
"github.com/Yuzuki616/V2bX/conf"
|
||||
"github.com/goccy/go-json"
|
||||
@ -52,16 +53,16 @@ func BuildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s
|
||||
in.SniffingConfig = sniffingConfig
|
||||
if *in.StreamSetting.Network == "tcp" {
|
||||
if in.StreamSetting.TCPSettings != nil {
|
||||
in.StreamSetting.TCPSettings.AcceptProxyProtocol = config.EnableProxyProtocol
|
||||
in.StreamSetting.TCPSettings.AcceptProxyProtocol = config.XrayOptions.EnableProxyProtocol
|
||||
} else {
|
||||
tcpSetting := &coreConf.TCPConfig{
|
||||
AcceptProxyProtocol: config.EnableProxyProtocol,
|
||||
AcceptProxyProtocol: config.XrayOptions.EnableProxyProtocol,
|
||||
} //Enable proxy protocol
|
||||
in.StreamSetting.TCPSettings = tcpSetting
|
||||
}
|
||||
} else if *in.StreamSetting.Network == "ws" {
|
||||
in.StreamSetting.WSSettings = &coreConf.WebSocketConfig{
|
||||
AcceptProxyProtocol: config.EnableProxyProtocol} //Enable proxy protocol
|
||||
AcceptProxyProtocol: config.XrayOptions.EnableProxyProtocol} //Enable proxy protocol
|
||||
}
|
||||
// Set TLS or Reality settings
|
||||
if nodeInfo.Tls {
|
||||
@ -124,9 +125,9 @@ func BuildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s
|
||||
// Support ProxyProtocol for any transport protocol
|
||||
if *in.StreamSetting.Network != "tcp" &&
|
||||
*in.StreamSetting.Network != "ws" &&
|
||||
config.EnableProxyProtocol {
|
||||
config.XrayOptions.EnableProxyProtocol {
|
||||
socketConfig := &coreConf.SocketConfig{
|
||||
AcceptProxyProtocol: config.EnableProxyProtocol,
|
||||
AcceptProxyProtocol: config.XrayOptions.EnableProxyProtocol,
|
||||
TFO: config.XrayOptions.EnableTFO,
|
||||
} //Enable proxy protocol
|
||||
in.StreamSetting.SocketSettings = socketConfig
|
||||
|
34
conf/node.go
34
conf/node.go
@ -15,26 +15,26 @@ type ApiConfig struct {
|
||||
}
|
||||
|
||||
type ControllerConfig struct {
|
||||
ListenIP string `yaml:"ListenIP"`
|
||||
SendIP string `yaml:"SendIP"`
|
||||
EnableProxyProtocol bool `yaml:"EnableProxyProtocol"`
|
||||
XrayOptions XrayOptions `yaml:"XrayOptions"`
|
||||
HyOptions HyOptions `yaml:"HyOptions"`
|
||||
LimitConfig LimitConfig `yaml:"LimitConfig"`
|
||||
CertConfig *CertConfig `yaml:"CertConfig"`
|
||||
ListenIP string `yaml:"ListenIP"`
|
||||
SendIP string `yaml:"SendIP"`
|
||||
XrayOptions XrayOptions `yaml:"XrayOptions"`
|
||||
HyOptions HyOptions `yaml:"HyOptions"`
|
||||
LimitConfig LimitConfig `yaml:"LimitConfig"`
|
||||
CertConfig *CertConfig `yaml:"CertConfig"`
|
||||
}
|
||||
|
||||
type XrayOptions struct {
|
||||
EnableDNS bool `yaml:"EnableDNS"`
|
||||
DNSType string `yaml:"DNSType"`
|
||||
EnableVless bool `yaml:"EnableVless"`
|
||||
VlessFlow string `json:"VlessFlow"`
|
||||
EnableUot bool `yaml:"EnableUot"`
|
||||
EnableTFO bool `yaml:"EnableTFO"`
|
||||
DisableIVCheck bool `yaml:"DisableIVCheck"`
|
||||
DisableSniffing bool `yaml:"DisableSniffing"`
|
||||
EnableFallback bool `yaml:"EnableFallback"`
|
||||
FallBackConfigs []FallBackConfig `yaml:"FallBackConfigs"`
|
||||
EnableProxyProtocol bool `yaml:"EnableProxyProtocol"`
|
||||
EnableDNS bool `yaml:"EnableDNS"`
|
||||
DNSType string `yaml:"DNSType"`
|
||||
EnableVless bool `yaml:"EnableVless"`
|
||||
VlessFlow string `json:"VlessFlow"`
|
||||
EnableUot bool `yaml:"EnableUot"`
|
||||
EnableTFO bool `yaml:"EnableTFO"`
|
||||
DisableIVCheck bool `yaml:"DisableIVCheck"`
|
||||
DisableSniffing bool `yaml:"DisableSniffing"`
|
||||
EnableFallback bool `yaml:"EnableFallback"`
|
||||
FallBackConfigs []FallBackConfig `yaml:"FallBackConfigs"`
|
||||
}
|
||||
|
||||
type HyOptions struct {
|
||||
|
Loading…
Reference in New Issue
Block a user