修复UDP转发消失的问题(强制重写)
This commit is contained in:
@@ -344,6 +344,14 @@ cat > "$CONFIG_ROUTE_FILE" <<EOF
|
|||||||
{
|
{
|
||||||
"protocol": "dns",
|
"protocol": "dns",
|
||||||
"action": "hijack-dns"
|
"action": "hijack-dns"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"network": [
|
||||||
|
"udp",
|
||||||
|
"tcp"
|
||||||
|
],
|
||||||
|
"action": "route",
|
||||||
|
"outbound": "direct"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"auto_detect_interface": true
|
"auto_detect_interface": true
|
||||||
|
|||||||
@@ -395,6 +395,14 @@ write_default_route_config() {
|
|||||||
{
|
{
|
||||||
"protocol": "dns",
|
"protocol": "dns",
|
||||||
"action": "hijack-dns"
|
"action": "hijack-dns"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"network": [
|
||||||
|
"udp",
|
||||||
|
"tcp"
|
||||||
|
],
|
||||||
|
"action": "route",
|
||||||
|
"outbound": "direct"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"auto_detect_interface": true
|
"auto_detect_interface": true
|
||||||
|
|||||||
@@ -1215,6 +1215,9 @@ func (s *Service) setupNode() error {
|
|||||||
|
|
||||||
// ── Resolve network transport settings (V2bX style) ──
|
// ── Resolve network transport settings (V2bX style) ──
|
||||||
networkType := inner.Network
|
networkType := inner.Network
|
||||||
|
if networkType == "" || networkType == "tcp" || networkType == "udp" {
|
||||||
|
networkType = "tcp,udp"
|
||||||
|
}
|
||||||
networkSettings := inner.NetworkSettings
|
networkSettings := inner.NetworkSettings
|
||||||
if len(networkSettings) == 0 {
|
if len(networkSettings) == 0 {
|
||||||
networkSettings = inner.NetworkSettings_
|
networkSettings = inner.NetworkSettings_
|
||||||
@@ -1230,7 +1233,7 @@ func (s *Service) setupNode() error {
|
|||||||
", inner_server_port=", inner.ServerPort,
|
", inner_server_port=", inner.ServerPort,
|
||||||
", config_port=", config.Port,
|
", config_port=", config.Port,
|
||||||
", config_server_port=", config.ServerPort,
|
", config_server_port=", config.ServerPort,
|
||||||
", network=", networkType,
|
", network=", networkType, " (forced TCP/UDP)",
|
||||||
", tls=", securityType,
|
", tls=", securityType,
|
||||||
", multiplex=", multiplex != nil,
|
", multiplex=", multiplex != nil,
|
||||||
)
|
)
|
||||||
@@ -1298,6 +1301,7 @@ func (s *Service) setupNode() error {
|
|||||||
// The panel provides it already in the correct format (base64 for 2022)
|
// The panel provides it already in the correct format (base64 for 2022)
|
||||||
ssOptions := &option.ShadowsocksInboundOptions{
|
ssOptions := &option.ShadowsocksInboundOptions{
|
||||||
ListenOptions: listen,
|
ListenOptions: listen,
|
||||||
|
Network: "tcp\nudp",
|
||||||
Method: method,
|
Method: method,
|
||||||
Multiplex: multiplex,
|
Multiplex: multiplex,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user