Skip to content

Commit

Permalink
项目合并与重命名
Browse files Browse the repository at this point in the history
  • Loading branch information
xljiulang committed Jul 24, 2021
1 parent 5093e89 commit bb48f6b
Show file tree
Hide file tree
Showing 23 changed files with 53 additions and 47 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -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>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace FastGithub.DnscryptProxy
namespace FastGithub.DomainResolve
{
/// <summary>
/// 服务控制状态
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace FastGithub.DnscryptProxy
namespace FastGithub.DomainResolve
{
/// <summary>
/// DnscryptProxy后台服务
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace FastGithub.DnscryptProxy
namespace FastGithub.DomainResolve
{
/// <summary>
/// DnscryptProxy服务
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace FastGithub.Http
namespace FastGithub.DomainResolve
{
/// <summary>
/// 域名解析器
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace FastGithub.Http
namespace FastGithub.DomainResolve
{
/// <summary>
/// 域名解析器
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace FastGithub.DnscryptProxy
namespace FastGithub.DomainResolve
{
/// <summary>
/// doml配置工具
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions FastGithub.Http/FastGithub.Http.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
3 changes: 2 additions & 1 deletion FastGithub.Http/HttpClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using FastGithub.DomainResolve;
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
Expand Down
3 changes: 2 additions & 1 deletion FastGithub.Http/HttpClientFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Options;
using FastGithub.DomainResolve;
using Microsoft.Extensions.Options;

namespace FastGithub.Http
{
Expand Down
3 changes: 2 additions & 1 deletion FastGithub.Http/HttpClientHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using FastGithub.DomainResolve;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
Expand Down
2 changes: 0 additions & 2 deletions FastGithub.Http/HttpClientServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public static class HttpClientServiceCollectionExtensions
/// <returns></returns>
public static IServiceCollection AddHttpClient(this IServiceCollection services)
{
services.AddMemoryCache();
services.TryAddSingleton<IDomainResolver, DomainResolver>();
services.TryAddSingleton<IHttpClientFactory, HttpClientFactory>();
return services;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public static IServiceCollection AddReverseProxy(this IServiceCollection service
return services
.AddMemoryCache()
.AddHttpForwarder()
.AddHttpClient()
.AddSingleton<RequestLoggingMilldeware>()
.AddSingleton<ReverseProxyMiddleware>()
.AddHostedService<ReverseProxyHostedService>();
Expand Down
3 changes: 2 additions & 1 deletion FastGithub.Upgrade/UpgradeService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FastGithub.Http;
using FastGithub.DomainResolve;
using FastGithub.Http;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;
Expand Down
12 changes: 6 additions & 6 deletions FastGithub.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion FastGithub/FastGithub.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 2 additions & 1 deletion FastGithub/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public static IHostBuilder CreateHostBuilder(string[] args)
.ConfigureServices((ctx, services) =>
{
services.AddDnsServer();
services.AddDnscryptProxy();
services.AddDomainResolve();
services.AddHttpClient();
services.AddAppUpgrade();
services.AddReverseProxy();
services.AddSingleton<FastGithubConfig>();
Expand Down

0 comments on commit bb48f6b

Please sign in to comment.