-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
340 changed files
with
142,376 additions
and
3,240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/bin | ||
/obj | ||
/*.csproj.user | ||
/bin | ||
/obj | ||
/*.csproj.user | ||
FodyWeavers.xsd |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<assemblyIdentity version="1.0.0.0" name="Netch"/> | ||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> | ||
<security> | ||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> | ||
</requestedPrivileges> | ||
</security> | ||
</trustInfo> | ||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> | ||
<application> | ||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" /> | ||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" /> | ||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" /> | ||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" /> | ||
</application> | ||
</compatibility> | ||
<application xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<windowsSettings> | ||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware> | ||
</windowsSettings> | ||
</application> | ||
</assembly> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> | ||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> | ||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> | ||
<security> | ||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> | ||
</requestedPrivileges> | ||
</security> | ||
</trustInfo> | ||
<asmv3:application> | ||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> | ||
</asmv3:windowsSettings> | ||
</asmv3:application> | ||
|
||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> | ||
<application> | ||
<!-- Windows 7 --> | ||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" /> | ||
|
||
<!-- Windows 8 --> | ||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" /> | ||
|
||
<!-- Windows 8.1 --> | ||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" /> | ||
|
||
<!-- Windows 10 --> | ||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" /> | ||
</application> | ||
</compatibility> | ||
</assembly> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
namespace Netch; | ||
|
||
public static class Constants | ||
{ | ||
public const string TempConfig = "data\\last.json"; | ||
public const string TempRouteFile = "data\\route.txt"; | ||
|
||
public const string AioDnsRuleFile = "bin\\aiodns.conf"; | ||
public const string NFDriver = "bin\\nfdriver.sys"; | ||
public const string STUNServersFile = "bin\\stun.txt"; | ||
|
||
public const string LogFile = "logging\\application.log"; | ||
|
||
public const string OutputTemplate = @"[{Timestamp:yyyy-MM-dd HH:mm:ss}][{Level}] {Message:lj}{NewLine}{Exception}"; | ||
public const string EOF = "\r\n"; | ||
|
||
public const string DefaultGroup = "NONE"; | ||
|
||
public static class Parameter | ||
{ | ||
public const string Show = "-show"; | ||
public const string ForceUpdate = "-forceUpdate"; | ||
} | ||
|
||
public const string WintunDllFile = "bin\\wintun.dll"; | ||
public const string DisableModeDirectoryFileName = "disabled"; | ||
|
||
public const string DefaultPrimaryDNS = "1.1.1.1"; | ||
public const string DefaultCNPrimaryDNS = "223.5.5.5"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Netch.Interfaces; | ||
using Netch.Models; | ||
using static Netch.Interops.AioDNS; | ||
|
||
namespace Netch.Controllers; | ||
|
||
public class DNSController : IController | ||
{ | ||
public string Name => "DNS Service"; | ||
|
||
public async Task StartAsync() | ||
{ | ||
var aioDnsConfig = Global.Settings.AioDNS; | ||
|
||
Dial(NameList.TYPE_REST, ""); | ||
Dial(NameList.TYPE_LIST, Path.GetFullPath(Constants.AioDnsRuleFile)); | ||
// TODO remove ListenPort setting | ||
Dial(NameList.TYPE_LISN, $"127.0.0.1:{aioDnsConfig.ListenPort}"); | ||
Dial(NameList.TYPE_CDNS, $"{aioDnsConfig.ChinaDNS}"); | ||
Dial(NameList.TYPE_ODNS, $"{aioDnsConfig.OtherDNS}"); | ||
|
||
if (!await InitAsync()) | ||
throw new MessageException("AioDNS start failed."); | ||
} | ||
|
||
public Task StopAsync() | ||
{ | ||
return FreeAsync(); | ||
} | ||
} |
Oops, something went wrong.