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