|
|
|
@ -100,22 +100,22 @@ namespace v2rayN.Handler
|
|
|
|
|
{ |
|
|
|
|
v2rayConfig.inbounds = new List<Inbounds4Ray>(); |
|
|
|
|
|
|
|
|
|
Inbounds4Ray? inbound = GetInbound(_config.inbound[0], Global.InboundSocks, 0, true); |
|
|
|
|
Inbounds4Ray? inbound = GetInbound(_config.inbound[0], EInboundProtocol.socks, true); |
|
|
|
|
v2rayConfig.inbounds.Add(inbound); |
|
|
|
|
|
|
|
|
|
//http |
|
|
|
|
Inbounds4Ray? inbound2 = GetInbound(_config.inbound[0], Global.InboundHttp, 1, false); |
|
|
|
|
Inbounds4Ray? inbound2 = GetInbound(_config.inbound[0], EInboundProtocol.http, false); |
|
|
|
|
v2rayConfig.inbounds.Add(inbound2); |
|
|
|
|
|
|
|
|
|
if (_config.inbound[0].allowLANConn) |
|
|
|
|
{ |
|
|
|
|
if (_config.inbound[0].newPort4LAN) |
|
|
|
|
{ |
|
|
|
|
var inbound3 = GetInbound(_config.inbound[0], Global.InboundSocks2, 2, true); |
|
|
|
|
var inbound3 = GetInbound(_config.inbound[0], EInboundProtocol.socks2, true); |
|
|
|
|
inbound3.listen = "0.0.0.0"; |
|
|
|
|
v2rayConfig.inbounds.Add(inbound3); |
|
|
|
|
|
|
|
|
|
var inbound4 = GetInbound(_config.inbound[0], Global.InboundHttp2, 3, false); |
|
|
|
|
var inbound4 = GetInbound(_config.inbound[0], EInboundProtocol.http2, false); |
|
|
|
|
inbound4.listen = "0.0.0.0"; |
|
|
|
|
v2rayConfig.inbounds.Add(inbound4); |
|
|
|
|
|
|
|
|
@ -143,7 +143,7 @@ namespace v2rayN.Handler
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Inbounds4Ray? GetInbound(InItem inItem, string tag, int offset, bool bSocks) |
|
|
|
|
private Inbounds4Ray? GetInbound(InItem inItem, EInboundProtocol protocol, bool bSocks) |
|
|
|
|
{ |
|
|
|
|
string result = Utile.GetEmbedText(Global.V2raySampleInbound); |
|
|
|
|
if (Utile.IsNullOrEmpty(result)) |
|
|
|
@ -156,9 +156,9 @@ namespace v2rayN.Handler
|
|
|
|
|
{ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
inbound.tag = tag; |
|
|
|
|
inbound.port = inItem.localPort + offset; |
|
|
|
|
inbound.protocol = bSocks ? Global.InboundSocks : Global.InboundHttp; |
|
|
|
|
inbound.tag = protocol.ToString(); |
|
|
|
|
inbound.port = inItem.localPort + (int)protocol; |
|
|
|
|
inbound.protocol = bSocks ? EInboundProtocol.socks.ToString() : EInboundProtocol.http.ToString(); |
|
|
|
|
inbound.settings.udp = inItem.udpEnabled; |
|
|
|
|
inbound.sniffing.enabled = inItem.sniffingEnabled; |
|
|
|
|
inbound.sniffing.routeOnly = inItem.routeOnly; |
|
|
|
@ -975,9 +975,9 @@ namespace v2rayN.Handler
|
|
|
|
|
{ |
|
|
|
|
listen = Global.Loopback, |
|
|
|
|
port = port, |
|
|
|
|
protocol = Global.InboundHttp |
|
|
|
|
protocol = EInboundProtocol.http.ToString(), |
|
|
|
|
}; |
|
|
|
|
inbound.tag = Global.InboundHttp + inbound.port.ToString(); |
|
|
|
|
inbound.tag = inbound.protocol + inbound.port.ToString(); |
|
|
|
|
v2rayConfig.inbounds.Add(inbound); |
|
|
|
|
|
|
|
|
|
//outbound |
|
|
|
|