项目合并与重命名

This commit is contained in:
xljiulang 2021-07-24 23:30:47 +08:00
parent 5093e8974b
commit bb48f6b760
23 changed files with 53 additions and 47 deletions

View File

@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>1.0.9</Version>
<Version>1.1.0</Version>
<Nullable>enable</Nullable>
<Description>github加速神器</Description>
<Copyright>https://github.com/xljiulang/FastGithub</Copyright>

View File

@ -1,23 +0,0 @@
using FastGithub.DnscryptProxy;
using Microsoft.Extensions.DependencyInjection;
namespace FastGithub
{
/// <summary>
/// DnscryptProxy的服务注册扩展
/// </summary>
public static class DnscryptProxyServiceCollectionExtensions
{
/// <summary>
/// 添加DnscryptProxy
/// </summary>
/// <param name="services"></param>
/// <returns></returns>
public static IServiceCollection AddDnscryptProxy(this IServiceCollection services)
{
return services
.AddSingleton<DnscryptProxyService>()
.AddHostedService<DnscryptProxyHostedService>();
}
}
}

View File

@ -1,4 +1,4 @@
namespace FastGithub.DnscryptProxy
namespace FastGithub.DomainResolve
{
/// <summary>
/// 服务控制状态

View File

@ -4,7 +4,7 @@ using System;
using System.Threading;
using System.Threading.Tasks;
namespace FastGithub.DnscryptProxy
namespace FastGithub.DomainResolve
{
/// <summary>
/// DnscryptProxy后台服务

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace FastGithub.DnscryptProxy
namespace FastGithub.DomainResolve
{
/// <summary>
/// DnscryptProxy服务

View File

@ -0,0 +1,26 @@
using FastGithub.DomainResolve;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
namespace FastGithub
{
/// <summary>
/// 域名解析相关服务注册扩展
/// </summary>
public static class DomainResolveServiceCollectionExtensions
{
/// <summary>
/// 注册域名解析相关服务
/// </summary>
/// <param name="services"></param>
/// <returns></returns>
public static IServiceCollection AddDomainResolve(this IServiceCollection services)
{
services.AddMemoryCache();
services.TryAddSingleton<IDomainResolver, DomainResolver>();
services.AddSingleton<DnscryptProxyService>();
services.AddHostedService<DnscryptProxyHostedService>();
return services;
}
}
}

View File

@ -8,7 +8,7 @@ using System.Net;
using System.Threading;
using System.Threading.Tasks;
namespace FastGithub.Http
namespace FastGithub.DomainResolve
{
/// <summary>
/// 域名解析器

View File

@ -5,6 +5,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DNS" Version="6.1.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
<ProjectReference Include="..\FastGithub.Core\FastGithub.Core.csproj" />
</ItemGroup>

View File

@ -2,7 +2,7 @@
using System.Threading;
using System.Threading.Tasks;
namespace FastGithub.Http
namespace FastGithub.DomainResolve
{
/// <summary>
/// 域名解析器

View File

@ -5,7 +5,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace FastGithub.DnscryptProxy
namespace FastGithub.DomainResolve
{
/// <summary>
/// doml配置工具

View File

@ -5,10 +5,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DNS" Version="6.1.0" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.10" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
<ProjectReference Include="..\FastGithub.Core\FastGithub.Core.csproj" />
<ProjectReference Include="..\FastGithub.DomainResolve\FastGithub.DomainResolve.csproj" />
</ItemGroup>
</Project>

View File

@ -1,4 +1,5 @@
using System;
using FastGithub.DomainResolve;
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;

View File

@ -1,4 +1,5 @@
using Microsoft.Extensions.Options;
using FastGithub.DomainResolve;
using Microsoft.Extensions.Options;
namespace FastGithub.Http
{

View File

@ -1,4 +1,5 @@
using System;
using FastGithub.DomainResolve;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

View File

@ -16,8 +16,6 @@ namespace FastGithub
/// <returns></returns>
public static IServiceCollection AddHttpClient(this IServiceCollection services)
{
services.AddMemoryCache();
services.TryAddSingleton<IDomainResolver, DomainResolver>();
services.TryAddSingleton<IHttpClientFactory, HttpClientFactory>();
return services;
}

View File

@ -18,7 +18,6 @@ namespace FastGithub
return services
.AddMemoryCache()
.AddHttpForwarder()
.AddHttpClient()
.AddSingleton<RequestLoggingMilldeware>()
.AddSingleton<ReverseProxyMiddleware>()
.AddHostedService<ReverseProxyHostedService>();

View File

@ -1,4 +1,5 @@
using FastGithub.Http;
using FastGithub.DomainResolve;
using FastGithub.Http;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;

View File

@ -13,10 +13,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.Upgrade", "FastG
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.ReverseProxy", "FastGithub.ReverseProxy\FastGithub.ReverseProxy.csproj", "{28326D0F-B0FB-4B6B-A65A-C69ACB72CAD8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.DnscryptProxy", "FastGithub.DnscryptProxy\FastGithub.DnscryptProxy.csproj", "{26BB826F-4117-4746-9BD0-C6D8043E2808}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.Http", "FastGithub.Http\FastGithub.Http.csproj", "{B5DCB3E4-5094-4170-B844-6F395002CA42}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.DomainResolve", "FastGithub.DomainResolve\FastGithub.DomainResolve.csproj", "{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -43,14 +43,14 @@ Global
{28326D0F-B0FB-4B6B-A65A-C69ACB72CAD8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28326D0F-B0FB-4B6B-A65A-C69ACB72CAD8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28326D0F-B0FB-4B6B-A65A-C69ACB72CAD8}.Release|Any CPU.Build.0 = Release|Any CPU
{26BB826F-4117-4746-9BD0-C6D8043E2808}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{26BB826F-4117-4746-9BD0-C6D8043E2808}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26BB826F-4117-4746-9BD0-C6D8043E2808}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26BB826F-4117-4746-9BD0-C6D8043E2808}.Release|Any CPU.Build.0 = Release|Any CPU
{B5DCB3E4-5094-4170-B844-6F395002CA42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B5DCB3E4-5094-4170-B844-6F395002CA42}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B5DCB3E4-5094-4170-B844-6F395002CA42}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B5DCB3E4-5094-4170-B844-6F395002CA42}.Release|Any CPU.Build.0 = Release|Any CPU
{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -16,8 +16,8 @@
<ItemGroup>
<PackageReference Include="PInvoke.AdvApi32" Version="0.7.104" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
<ProjectReference Include="..\FastGithub.DnscryptProxy\FastGithub.DnscryptProxy.csproj" />
<ProjectReference Include="..\FastGithub.Dns\FastGithub.Dns.csproj" />
<ProjectReference Include="..\FastGithub.DomainResolve\FastGithub.DomainResolve.csproj" />
<ProjectReference Include="..\FastGithub.ReverseProxy\FastGithub.ReverseProxy.csproj" />
<ProjectReference Include="..\FastGithub.Upgrade\FastGithub.Upgrade.csproj" />
</ItemGroup>

View File

@ -42,7 +42,8 @@ namespace FastGithub
.ConfigureServices((ctx, services) =>
{
services.AddDnsServer();
services.AddDnscryptProxy();
services.AddDomainResolve();
services.AddHttpClient();
services.AddAppUpgrade();
services.AddReverseProxy();
services.AddSingleton<FastGithubConfig>();