Fix core config

This commit is contained in:
DHR60 2026-05-09 22:11:08 +08:00
parent d50c0dfc6a
commit 1d38f16d40

View file

@ -10,9 +10,9 @@ public partial class CoreConfigV2rayService
var listenPort = AppManager.Instance.GetLocalPort(EInboundProtocol.socks); var listenPort = AppManager.Instance.GetLocalPort(EInboundProtocol.socks);
_coreConfig.inbounds = []; _coreConfig.inbounds = [];
var inbound = BuildInbound(_config.Inbound.First(), EInboundProtocol.socks, true); var inbound = BuildInbound(_config.Inbound.First(), EInboundProtocol.socks, true);
var isUsingLocalMixedPort = _node.Address == Global.Loopback && _node.Port == listenPort;
if (!context.IsTunEnabled if (!context.IsTunEnabled || !isUsingLocalMixedPort)
|| (context.IsTunEnabled && _node.Address != Global.Loopback && _node.Port != listenPort))
{ {
_coreConfig.inbounds.Add(inbound); _coreConfig.inbounds.Add(inbound);