mirror of
https://github.com/netchx/netch.git
synced 2026-04-21 21:19:52 +08:00
更新 NTT
更新 V2ray to v4.27.0
This commit is contained in:
@@ -7,6 +7,12 @@ namespace Netch.Controllers
|
||||
{
|
||||
public class NTTController : Controller
|
||||
{
|
||||
private string _Other_address;
|
||||
private string _Binding_test;
|
||||
private string _Local_address;
|
||||
private string _Mapped_address;
|
||||
private string _Nat_mapping_behavior;
|
||||
private string _Nat_filtering_behavior;
|
||||
private string _lastResult;
|
||||
|
||||
public NTTController()
|
||||
@@ -31,10 +37,14 @@ namespace Netch.Controllers
|
||||
Instance.BeginErrorReadLine();
|
||||
Instance.WaitForExit();
|
||||
|
||||
var result = _lastResult.Split('#');
|
||||
var natType = result[0];
|
||||
var localEnd = result[1];
|
||||
var publicEnd = result[2];
|
||||
/* var result = _lastResult.Split('\n');
|
||||
var natType = result[0];
|
||||
var localEnd = result[1];
|
||||
var publicEnd = result[2];*/
|
||||
|
||||
var natType = _lastResult;
|
||||
var localEnd = _Local_address;
|
||||
var publicEnd = _Mapped_address;
|
||||
|
||||
return (true, natType, localEnd, publicEnd);
|
||||
}
|
||||
@@ -57,7 +67,22 @@ namespace Netch.Controllers
|
||||
private new void OnOutputDataReceived(object sender, DataReceivedEventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(e.Data))
|
||||
_lastResult = e.Data;
|
||||
{
|
||||
if (e.Data.StartsWith("Other address is: "))
|
||||
_Other_address = e.Data.Split(':')[1].Trim();
|
||||
if (e.Data.StartsWith("Binding test: "))
|
||||
_Binding_test = e.Data.Split(':')[1].Trim();
|
||||
if (e.Data.StartsWith("Local address: "))
|
||||
_Local_address = e.Data.Split(':')[1].Trim();
|
||||
if (e.Data.StartsWith("Mapped address: "))
|
||||
_Mapped_address = e.Data.Split(':')[1].Trim();
|
||||
if (e.Data.StartsWith("Nat mapping behavior: "))
|
||||
_Nat_mapping_behavior = e.Data.Split(':')[1].Trim();
|
||||
if (e.Data.StartsWith("Nat filtering behavior: "))
|
||||
_Nat_filtering_behavior = e.Data.Split(':')[1].Trim();
|
||||
if (e.Data.StartsWith("result: "))
|
||||
_lastResult = e.Data.Split(':')[1].Trim();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Stop()
|
||||
|
||||
2
binaries
2
binaries
Submodule binaries updated: 422c811311...5973ce45ed
Reference in New Issue
Block a user