From 8312886db7033a571fe22eb7fda4ade9e1f9554a Mon Sep 17 00:00:00 2001 From: xljiulang <366193849@qq.com> Date: Sun, 18 Jul 2021 13:03:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=86=E5=88=86=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub/Program.cs | 9 ++++ FastGithub/README.MD | 2 +- FastGithub/README.html | 2 +- FastGithub/appsettings.github.json | 32 ++++++++++++ FastGithub/appsettings.json | 61 +---------------------- FastGithub/appsettings.stackoverflow.json | 37 ++++++++++++++ 6 files changed, 81 insertions(+), 62 deletions(-) create mode 100644 FastGithub/appsettings.github.json create mode 100644 FastGithub/appsettings.stackoverflow.json diff --git a/FastGithub/Program.cs b/FastGithub/Program.cs index eeca4ab..d3208c0 100644 --- a/FastGithub/Program.cs +++ b/FastGithub/Program.cs @@ -1,6 +1,8 @@ using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using System.IO; namespace FastGithub { @@ -30,6 +32,13 @@ namespace FastGithub { c.ValidateOnBuild = false; }) + .ConfigureAppConfiguration(c => + { + foreach (var jsonFile in Directory.GetFiles(".", "appsettings.*.json")) + { + c.AddJsonFile(jsonFile, optional: true); + } + }) .ConfigureServices((ctx, services) => { services.AddAppUpgrade(); diff --git a/FastGithub/README.MD b/FastGithub/README.MD index da8b352..a9fd2f5 100644 --- a/FastGithub/README.MD +++ b/FastGithub/README.MD @@ -1,4 +1,4 @@ -# FastGithub +# FastGithub github加速神器 ### 本机使用[推荐] diff --git a/FastGithub/README.html b/FastGithub/README.html index ebb1ad7..660f516 100644 --- a/FastGithub/README.html +++ b/FastGithub/README.html @@ -1,4 +1,4 @@ - +
diff --git a/FastGithub/appsettings.github.json b/FastGithub/appsettings.github.json new file mode 100644 index 0000000..3b1d9db --- /dev/null +++ b/FastGithub/appsettings.github.json @@ -0,0 +1,32 @@ +{ + "FastGithub": { + "DomainConfigs": { // 域名的*表示0到多个任意字符 + "github.com": { + "TlsSni": false, // 指示tls握手时是否发送SNI + "Timeout": null, // 请求超时时长,格式为"00:02:00",默认为null + "Destination": null // 请求目的地,格式为绝对或相对Uri,默认null + }, + "githubstatus.com": { + "TlsSni": false + }, + "*.github.com": { + "TlsSni": false + }, + "*.github.io": { + "TlsSni": false + }, + "*.githubapp.com": { + "TlsSni": false + }, + "*.githubassets.com": { + "TlsSni": false + }, + "*.githubusercontent.com": { + "TlsSni": false + }, + "*github*.s3.amazonaws.com": { + "TlsSni": false + } + } + } +} diff --git a/FastGithub/appsettings.json b/FastGithub/appsettings.json index 992c03c..bb26872 100644 --- a/FastGithub/appsettings.json +++ b/FastGithub/appsettings.json @@ -1,4 +1,4 @@ -{ +{ "FastGithub": { "PureDns": { // 用于解析DomainConfigs的域名 "IPAddress": "127.0.0.1", @@ -7,65 +7,6 @@ "FastDns": { // 用于解析不在DomainConfigs的域名 "IPAddress": "114.114.114.114", "Port": 53 - }, - "DomainConfigs": { // 域名的*表示0到多个任意字符 - "github.com": { - "TlsSni": false, // 指示tls握手时是否发送SNI - "Timeout": null, // 请求超时时长,格式为"00:02:00",默认为null - "Destination": null // 请求目的地,格式为绝对或相对Uri,默认null - }, - "githubstatus.com": { - "TlsSni": false - }, - "*.github.com": { - "TlsSni": false - }, - "*.github.io": { - "TlsSni": false - }, - "*.githubapp.com": { - "TlsSni": false - }, - "*.githubassets.com": { - "TlsSni": false - }, - "*.githubusercontent.com": { - "TlsSni": false - }, - "*github*.s3.amazonaws.com": { - "TlsSni": false - }, - "ajax.googleapis.com": { - "TlsSni": true, - "Destination": "https://gapis.geekzu.org/ajax/" - }, - "fonts.googleapis.com": { - "TlsSni": true, - "Destination": "https://fonts.geekzu.org/" - }, - "themes.googleusercontent.com": { - "TlsSni": true, - "Destination": "https://gapis.geekzu.org/g-themes/" - }, - "fonts.gstatic.com": { - "TlsSni": true, - "Destination": "https://gapis.geekzu.org/g-fonts/" - }, - "secure.gravatar.com": { - "TlsSni": true, - "Destination": "https://sdn.geekzu.org/" - }, - "*.gravatar.com": { - "TlsSni": true, - "Destination": "https://fdn.geekzu.org/" - }, - "i.stack.imgur.com": { - "Response": { // 直接响应 - "StatusCode": 404, - "ContentType": "text/plain;charset=utf-8", - "ContentValue": "阻断的请求" - } - } } }, "Logging": { diff --git a/FastGithub/appsettings.stackoverflow.json b/FastGithub/appsettings.stackoverflow.json new file mode 100644 index 0000000..941ff2f --- /dev/null +++ b/FastGithub/appsettings.stackoverflow.json @@ -0,0 +1,37 @@ +{ + "FastGithub": { + "DomainConfigs": { // 域名的*表示0到多个任意字符 + "ajax.googleapis.com": { + "TlsSni": true, + "Destination": "https://gapis.geekzu.org/ajax/" + }, + "fonts.googleapis.com": { + "TlsSni": true, + "Destination": "https://fonts.geekzu.org/" + }, + "themes.googleusercontent.com": { + "TlsSni": true, + "Destination": "https://gapis.geekzu.org/g-themes/" + }, + "fonts.gstatic.com": { + "TlsSni": true, + "Destination": "https://gapis.geekzu.org/g-fonts/" + }, + "secure.gravatar.com": { + "TlsSni": true, + "Destination": "https://sdn.geekzu.org/" + }, + "*.gravatar.com": { + "TlsSni": true, + "Destination": "https://fdn.geekzu.org/" + }, + "i.stack.imgur.com": { + "Response": { // 直接响应 + "StatusCode": 404, + "ContentType": "text/plain;charset=utf-8", + "ContentValue": "阻断的请求" + } + } + } + } +}