Skip to content

Commit

Permalink
🔥 Remove ProxyMode.DNSIntercept
Browse files Browse the repository at this point in the history
  • Loading branch information
AigioL committed Aug 6, 2024
1 parent c8509e9 commit 3eae8a8
Show file tree
Hide file tree
Showing 14 changed files with 570 additions and 568 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsOSPlatform('windows')) AND ($(RuntimeIdentifier.StartsWith('win-')) OR $(RuntimeIdentifier) == '')">
<!--<ItemGroup Condition="$([MSBuild]::IsOSPlatform('windows')) AND ($(RuntimeIdentifier.StartsWith('win-')) OR $(RuntimeIdentifier) == '')">
<PackageReference Include="Aigio.WinDivertSharp" />
</ItemGroup>
</ItemGroup>-->

<ItemGroup>
<ProjectReference Include="..\..\ref\WTTS.MicroServices.ClientSDK\src\BD.WTTS.MicroServices.Primitives.Models\BD.WTTS.MicroServices.Primitives.Models.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,28 +148,28 @@ internal static IServiceCollection AddFlowAnalyze(this IServiceCollection servic

#if WINDOWS

/// <summary>
/// 注册数据包拦截器
/// </summary>
/// <param name="services"></param>
/// <returns></returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static IServiceCollection AddPacketIntercept(this IServiceCollection services)
{
// https://github.com/dotnetcore/FastGithub/blob/2.1.4/FastGithub.PacketIntercept/ServiceCollectionExtensions.cs#L21
//services.AddSingleton<IDnsConflictSolver, HostsConflictSolver>();
//services.AddSingleton<IDnsConflictSolver, ProxyConflictSolver>();
services.TryAddSingleton<IDnsInterceptor, DnsInterceptor>();
services.AddHostedService<DnsInterceptHostedService>();

services.AddSingleton<ITcpInterceptor, SshInterceptor>();
services.AddSingleton<ITcpInterceptor, GitInterceptor>();
services.AddSingleton<ITcpInterceptor, HttpInterceptor>();
services.AddSingleton<ITcpInterceptor, HttpsInterceptor>();
services.AddHostedService<TcpInterceptHostedService>();

return services;
}
///// <summary>
///// 注册数据包拦截器
///// </summary>
///// <param name="services"></param>
///// <returns></returns>
//[MethodImpl(MethodImplOptions.AggressiveInlining)]
//internal static IServiceCollection AddPacketIntercept(this IServiceCollection services)
//{
// // https://github.com/dotnetcore/FastGithub/blob/2.1.4/FastGithub.PacketIntercept/ServiceCollectionExtensions.cs#L21
// //services.AddSingleton<IDnsConflictSolver, HostsConflictSolver>();
// //services.AddSingleton<IDnsConflictSolver, ProxyConflictSolver>();
// services.TryAddSingleton<IDnsInterceptor, DnsInterceptor>();
// services.AddHostedService<DnsInterceptHostedService>();

// services.AddSingleton<ITcpInterceptor, SshInterceptor>();
// services.AddSingleton<ITcpInterceptor, GitInterceptor>();
// services.AddSingleton<ITcpInterceptor, HttpInterceptor>();
// services.AddSingleton<ITcpInterceptor, HttpsInterceptor>();
// services.AddHostedService<TcpInterceptHostedService>();

// return services;
//}

#endif
}
Loading

0 comments on commit 3eae8a8

Please sign in to comment.