@@ -148,28 +148,28 @@ internal static IServiceCollection AddFlowAnalyze(this IServiceCollection servic
148148
149149#if WINDOWS
150150
151- ///// <summary>
152- ///// 注册数据包拦截器
153- ///// </summary>
154- ///// <param name="services"></param>
155- ///// <returns></returns>
156- // [MethodImpl(MethodImplOptions.AggressiveInlining)]
157- // internal static IServiceCollection AddPacketIntercept(this IServiceCollection services)
158- // {
159- // // https://github.com/dotnetcore/FastGithub/blob/2.1.4/FastGithub.PacketIntercept/ServiceCollectionExtensions.cs#L21
160- // //services.AddSingleton<IDnsConflictSolver, HostsConflictSolver>();
161- // //services.AddSingleton<IDnsConflictSolver, ProxyConflictSolver>();
162- // services.TryAddSingleton<IDnsInterceptor, DnsInterceptor>();
163- // services.AddHostedService<DnsInterceptHostedService>();
164-
165- // services.AddSingleton<ITcpInterceptor, SshInterceptor>();
166- // services.AddSingleton<ITcpInterceptor, GitInterceptor>();
167- // services.AddSingleton<ITcpInterceptor, HttpInterceptor>();
168- // services.AddSingleton<ITcpInterceptor, HttpsInterceptor>();
169- // services.AddHostedService<TcpInterceptHostedService>();
170-
171- // return services;
172- // }
151+ /// <summary>
152+ /// 注册数据包拦截器
153+ /// </summary>
154+ /// <param name="services"></param>
155+ /// <returns></returns>
156+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
157+ internal static IServiceCollection AddPacketIntercept ( this IServiceCollection services )
158+ {
159+ // https://github.com/dotnetcore/FastGithub/blob/2.1.4/FastGithub.PacketIntercept/ServiceCollectionExtensions.cs#L21
160+ //services.AddSingleton<IDnsConflictSolver, HostsConflictSolver>();
161+ //services.AddSingleton<IDnsConflictSolver, ProxyConflictSolver>();
162+ services . TryAddSingleton < IDnsInterceptor , DnsInterceptor > ( ) ;
163+ services . AddHostedService < DnsInterceptHostedService > ( ) ;
164+
165+ services . AddSingleton < ITcpInterceptor , SshInterceptor > ( ) ;
166+ services . AddSingleton < ITcpInterceptor , GitInterceptor > ( ) ;
167+ services . AddSingleton < ITcpInterceptor , HttpInterceptor > ( ) ;
168+ services . AddSingleton < ITcpInterceptor , HttpsInterceptor > ( ) ;
169+ services . AddHostedService < TcpInterceptHostedService > ( ) ;
170+
171+ return services ;
172+ }
173173
174174#endif
175175}
0 commit comments