[go: up one dir, main page]

Skip to content

Commit

Permalink
fix: local vless flow config doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
Septrum101 committed May 25, 2023
1 parent 9590697 commit 4ab196a
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 30 deletions.
1 change: 1 addition & 0 deletions api/apimodel.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Config struct {
Key string `mapstructure:"ApiKey"`
NodeType string `mapstructure:"NodeType"`
EnableVless bool `mapstructure:"EnableVless"`
VlessFlow string `mapstructure:"VlessFlow"`
Timeout int `mapstructure:"Timeout"`
SpeedLimit float64 `mapstructure:"SpeedLimit"`
DeviceLimit int `mapstructure:"DeviceLimit"`
Expand Down
3 changes: 3 additions & 0 deletions api/newV2board/v2board.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type APIClient struct {
Key string
NodeType string
EnableVless bool
VlessFlow string
SpeedLimit float64
DeviceLimit int
LocalRuleList []api.DetectRule
Expand Down Expand Up @@ -68,6 +69,7 @@ func New(apiConfig *api.Config) *APIClient {
APIHost: apiConfig.APIHost,
NodeType: apiConfig.NodeType,
EnableVless: apiConfig.EnableVless,
VlessFlow: apiConfig.VlessFlow,
SpeedLimit: apiConfig.SpeedLimit,
DeviceLimit: apiConfig.DeviceLimit,
LocalRuleList: localRuleList,
Expand Down Expand Up @@ -382,6 +384,7 @@ func (c *APIClient) parseV2rayNodeResponse(s *serverConfig) (*api.NodeInfo, erro
Path: s.NetworkSettings.Path,
Host: host,
EnableVless: c.EnableVless,
VlessFlow: c.VlessFlow,
ServiceName: s.NetworkSettings.ServiceName,
Header: header,
NameServerConfig: s.parseDNSConfig(),
Expand Down
3 changes: 3 additions & 0 deletions api/pmpanel/pmpanel.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type APIClient struct {
Key string
NodeType string
EnableVless bool
VlessFlow string
SpeedLimit float64
DeviceLimit int
LocalRuleList []api.DetectRule
Expand Down Expand Up @@ -60,6 +61,7 @@ func New(apiConfig *api.Config) *APIClient {
APIHost: apiConfig.APIHost,
NodeType: apiConfig.NodeType,
EnableVless: apiConfig.EnableVless,
VlessFlow: apiConfig.VlessFlow,
SpeedLimit: apiConfig.SpeedLimit,
DeviceLimit: apiConfig.DeviceLimit,
LocalRuleList: localRuleList,
Expand Down Expand Up @@ -396,6 +398,7 @@ func (c *APIClient) ParseV2rayNodeResponse(nodeInfoResponse *NodeInfoResponse) (
Path: path,
Host: host,
EnableVless: c.EnableVless,
VlessFlow: c.VlessFlow,
ServiceName: serviceName,
}

Expand Down
3 changes: 3 additions & 0 deletions api/proxypanel/proxypanel.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type APIClient struct {
Key string
NodeType string
EnableVless bool
VlessFlow string
SpeedLimit float64
DeviceLimit int
LocalRuleList []api.DetectRule
Expand Down Expand Up @@ -56,6 +57,7 @@ func New(apiConfig *api.Config) *APIClient {
APIHost: apiConfig.APIHost,
NodeType: apiConfig.NodeType,
EnableVless: apiConfig.EnableVless,
VlessFlow: apiConfig.VlessFlow,
SpeedLimit: apiConfig.SpeedLimit,
DeviceLimit: apiConfig.DeviceLimit,
LocalRuleList: localRuleList,
Expand Down Expand Up @@ -440,6 +442,7 @@ func (c *APIClient) ParseV2rayNodeResponse(nodeInfoResponse *json.RawMessage) (*
Path: v2rayNodeInfo.V2Path,
Host: v2rayNodeInfo.V2Host,
EnableVless: c.EnableVless,
VlessFlow: c.VlessFlow,
}

return nodeInfo, nil
Expand Down
3 changes: 3 additions & 0 deletions api/sspanel/sspanel.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type APIClient struct {
Key string
NodeType string
EnableVless bool
VlessFlow string
SpeedLimit float64
DeviceLimit int
DisableCustomConfig bool
Expand Down Expand Up @@ -73,6 +74,7 @@ func New(apiConfig *api.Config) *APIClient {
APIHost: apiConfig.APIHost,
NodeType: apiConfig.NodeType,
EnableVless: apiConfig.EnableVless,
VlessFlow: apiConfig.VlessFlow,
SpeedLimit: apiConfig.SpeedLimit,
DeviceLimit: apiConfig.DeviceLimit,
LocalRuleList: localRuleList,
Expand Down Expand Up @@ -457,6 +459,7 @@ func (c *APIClient) ParseV2rayNodeResponse(nodeInfoResponse *NodeInfoResponse) (
Path: path,
Host: host,
EnableVless: c.EnableVless,
VlessFlow: c.VlessFlow,
ServiceName: serviceName,
Header: header,
}
Expand Down
3 changes: 3 additions & 0 deletions api/v2board/v2board.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type APIClient struct {
Key string
NodeType string
EnableVless bool
VlessFlow string
SpeedLimit float64
DeviceLimit int
LocalRuleList []api.DetectRule
Expand Down Expand Up @@ -66,6 +67,7 @@ func New(apiConfig *api.Config) *APIClient {
APIHost: apiConfig.APIHost,
NodeType: apiConfig.NodeType,
EnableVless: apiConfig.EnableVless,
VlessFlow: apiConfig.VlessFlow,
SpeedLimit: apiConfig.SpeedLimit,
DeviceLimit: apiConfig.DeviceLimit,
LocalRuleList: localRuleList,
Expand Down Expand Up @@ -406,6 +408,7 @@ func (c *APIClient) ParseV2rayNodeResponse(nodeInfoResponse *simplejson.Json) (*
Path: path,
Host: host,
EnableVless: c.EnableVless,
VlessFlow: c.VlessFlow,
ServiceName: serviceName,
Header: header,
}
Expand Down
3 changes: 3 additions & 0 deletions api/v2raysocks/v2raysocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type APIClient struct {
Key string
NodeType string
EnableVless bool
VlessFlow string
SpeedLimit float64
DeviceLimit int
LocalRuleList []api.DetectRule
Expand Down Expand Up @@ -66,6 +67,7 @@ func New(apiConfig *api.Config) *APIClient {
APIHost: apiConfig.APIHost,
NodeType: apiConfig.NodeType,
EnableVless: apiConfig.EnableVless,
VlessFlow: apiConfig.VlessFlow,
SpeedLimit: apiConfig.SpeedLimit,
DeviceLimit: apiConfig.DeviceLimit,
LocalRuleList: localRuleList,
Expand Down Expand Up @@ -404,6 +406,7 @@ func (c *APIClient) ParseV2rayNodeResponse(nodeInfoResponse *simplejson.Json) (*
Path: path,
Host: host,
EnableVless: c.EnableVless,
VlessFlow: c.VlessFlow,
ServiceName: serviceName,
Header: header,
}
Expand Down
95 changes: 65 additions & 30 deletions main/config.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ ConnectionConfig:
DownlinkOnly: 4 # Time limit when the connection is closed after the uplink is closed, Second
BufferSize: 64 # The internal cache size of each connection, kB
Nodes:
-
PanelType: "SSpanel" # Panel type: SSpanel, V2board, NewV2board, PMpanel, Proxypanel, V2RaySocks
- PanelType: "SSpanel" # Panel type: SSpanel, V2board, NewV2board, PMpanel, Proxypanel, V2RaySocks
ApiConfig:
ApiHost: "http://127.0.0.1:667"
ApiKey: "123"
Expand Down Expand Up @@ -47,8 +46,7 @@ Nodes:
Expiry: 60 # Expiry time (second)
EnableFallback: false # Only support for Trojan and Vless
FallBackConfigs: # Support multiple fallbacks
-
SNI: # TLS SNI(Server Name Indication), Empty for any
- SNI: # TLS SNI(Server Name Indication), Empty for any
Alpn: # Alpn, Empty for any
Path: # HTTP PATH, Empty for any
Dest: 80 # Required, Destination of fallback, check https://xtls.github.io/config/features/fallback.html for details.
Expand Down Expand Up @@ -77,29 +75,66 @@ Nodes:
DNSEnv: # DNS ENV option used by DNS provider
ALICLOUD_ACCESS_KEY: aaa
ALICLOUD_SECRET_KEY: bbb
# -
# PanelType: "NewV2board" # Panel type: SSpanel, V2board, NewV2board, PMpanel, Proxypanel, V2RaySocks
# ApiConfig:
# ApiHost: "http://127.0.0.1:668"
# ApiKey: "123"
# NodeID: 4
# NodeType: Shadowsocks # Node type: V2ray, Shadowsocks, Trojan
# Timeout: 30 # Timeout for the api request
# EnableVless: false # Enable Vless for V2ray Type
# EnableXTLS: false # Enable XTLS for V2ray and Trojan
# SpeedLimit: 0 # Mbps, Local settings will replace remote settings
# DeviceLimit: 0 # Local settings will replace remote settings
# ControllerConfig:
# ListenIP: 0.0.0.0 # IP address you want to listen
# UpdatePeriodic: 10 # Time to update the nodeinfo, how many sec.
# EnableDNS: false # Use custom DNS config, Please ensure that you set the dns.json well
# CertConfig:
# CertMode: dns # Option about how to get certificate: none, file, http, dns
# CertDomain: "node1.test.com" # Domain to cert
# CertFile: /etc/XrayR/cert/node1.test.com.cert # Provided if the CertMode is file
# KeyFile: /etc/XrayR/cert/node1.test.com.pem
# Provider: alidns # DNS cert provider, Get the full support list here: https://go-acme.github.io/lego/dns/
# Email: test@me.com
# DNSEnv: # DNS ENV option used by DNS provider
# ALICLOUD_ACCESS_KEY: aaa
# ALICLOUD_SECRET_KEY: bbb

# - PanelType: "SSpanel" # Panel type: SSpanel, V2board, NewV2board, PMpanel, Proxypanel, V2RaySocks
# ApiConfig:
# ApiHost: "http://127.0.0.1:668"
# ApiKey: "123"
# NodeID: 41
# NodeType: V2ray # Node type: V2ray, Shadowsocks, Trojan, Shadowsocks-Plugin
# Timeout: 30 # Timeout for the api request
# EnableVless: false # Enable Vless for V2ray Type
# VlessFlow: "xtls-rprx-vision" # Only support vless
# SpeedLimit: 0 # Mbps, Local settings will replace remote settings, 0 means disable
# DeviceLimit: 0 # Local settings will replace remote settings, 0 means disable
# RuleListPath: # /etc/XrayR/rulelist Path to local rulelist file
# ControllerConfig:
# ListenIP: 0.0.0.0 # IP address you want to listen
# SendIP: 0.0.0.0 # IP address you want to send pacakage
# UpdatePeriodic: 60 # Time to update the nodeinfo, how many sec.
# EnableDNS: false # Use custom DNS config, Please ensure that you set the dns.json well
# DNSType: AsIs # AsIs, UseIP, UseIPv4, UseIPv6, DNS strategy
# EnableProxyProtocol: false # Only works for WebSocket and TCP
# AutoSpeedLimitConfig:
# Limit: 0 # Warned speed. Set to 0 to disable AutoSpeedLimit (mbps)
# WarnTimes: 0 # After (WarnTimes) consecutive warnings, the user will be limited. Set to 0 to punish overspeed user immediately.
# LimitSpeed: 0 # The speedlimit of a limited user (unit: mbps)
# LimitDuration: 0 # How many minutes will the limiting last (unit: minute)
# GlobalDeviceLimitConfig:
# Enable: false # Enable the global device limit of a user
# RedisAddr: 127.0.0.1:6379 # The redis server address
# RedisPassword: YOUR PASSWORD # Redis password
# RedisDB: 0 # Redis DB
# Timeout: 5 # Timeout for redis request
# Expiry: 60 # Expiry time (second)
# EnableFallback: false # Only support for Trojan and Vless
# FallBackConfigs: # Support multiple fallbacks
# - SNI: # TLS SNI(Server Name Indication), Empty for any
# Alpn: # Alpn, Empty for any
# Path: # HTTP PATH, Empty for any
# Dest: 80 # Required, Destination of fallback, check https://xtls.github.io/config/features/fallback.html for details.
# ProxyProtocolVer: 0 # Send PROXY protocol version, 0 for disable
# EnableREALITY: true # Enable REALITY
# REALITYConfigs:
# Show: true # Show REALITY debug
# Dest: www.smzdm.com:443 # Required, Same as fallback
# ProxyProtocolVer: 0 # Send PROXY protocol version, 0 for disable
# ServerNames: # Required, list of available serverNames for the client, * wildcard is not supported at the moment.
# - www.smzdm.com
# PrivateKey: YOUR_PRIVATE_KEY # Required, execute './xray x25519' to generate.
# MinClientVer: # Optional, minimum version of Xray client, format is x.y.z.
# MaxClientVer: # Optional, maximum version of Xray client, format is x.y.z.
# MaxTimeDiff: 0 # Optional, maximum allowed time difference, unit is in milliseconds.
# ShortIds: # Required, list of available shortIds for the client, can be used to differentiate between different clients.
# - ""
# - 0123456789abcdef
# CertConfig:
# CertMode: dns # Option about how to get certificate: none, file, http, tls, dns. Choose "none" will forcedly disable the tls config.
# CertDomain: "node1.test.com" # Domain to cert
# CertFile: /etc/XrayR/cert/node1.test.com.cert # Provided if the CertMode is file
# KeyFile: /etc/XrayR/cert/node1.test.com.key
# Provider: alidns # DNS cert provider, Get the full support list here: https://go-acme.github.io/lego/dns/
# Email: test@me.com
# DNSEnv: # DNS ENV option used by DNS provider
# ALICLOUD_ACCESS_KEY: aaa
# ALICLOUD_SECRET_KEY: bbb

0 comments on commit 4ab196a

Please sign in to comment.