Skip to content

Commit

Permalink
修复discord更新下载和图片失效
Browse files Browse the repository at this point in the history
新增github gist代理服务支持
  • Loading branch information
rmbadmin committed Jan 20, 2021
1 parent 79871c3 commit 686e398
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
8 changes: 7 additions & 1 deletion source/SteamTool.Proxy/HttpProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,13 @@ public bool StartProxy(bool IsProxyGOG = false)
{
foreach (var host in proxyDomain.Hosts)
{
hosts.Add((IPAddress.Loopback.ToString(), host));
if (host.Contains(" "))
{
var h = host.Split(' ');
hosts.Add((h[0], h[1]));
}
else
hosts.Add((IPAddress.Loopback.ToString(), host));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/SteamTool.Proxy/Model/ProxyDomainModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ProxyDomainModel
/// <summary>
/// 代理域名合集
/// </summary>
public List<string> Domains { get; set; }
public IReadOnlyCollection<string> Domains { get; set; }

/// <summary>
/// 端口
Expand All @@ -44,7 +44,7 @@ public class ProxyDomainModel
/// </summary>
public bool IsEnable { get; set; }

public IEnumerable<string> Hosts { get; set; }
public IReadOnlyCollection<string> Hosts { get; set; }

public DomainTag DomainTag { get; set; }
}
Expand Down
30 changes: 17 additions & 13 deletions source/SteamTools/Services/ProxyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,28 @@ public void Initialize()
"canary.discordapp.com",
"apps.discordapp.com",
"pax.discordapp.com",
"1.0.0.1 dl.discordapp.net",
"1.0.0.1 media.discordapp.net",
"1.0.0.1 images-ext-2.discordapp.net",
"1.0.0.1 images-ext-1.discordapp.net",
},
//ServerName= "discord.com",
DomainTag = DomainTag.Discord,
IsEnable= false,
},
new ProxyDomainModel{
Name=Resources.DiscordNet,
Domains = new List<string>{ "discordapp.net" },
ProxyIPAddres="162.159.130.232",
Hosts = new List<string>{
"dl.discordapp.net",
"media.discordapp.net",
"images-ext-2.discordapp.net",
"images-ext-1.discordapp.net",
},
DomainTag = DomainTag.DiscordNet,
IsEnable= false,
},
//new ProxyDomainModel{
//Name=Resources.DiscordNet,
//Domains = new List<string>{ "discordapp.net" },
//ProxyIPAddres="162.159.130.232",
//Hosts = new List<string>{
//"dl.discordapp.net",
//"media.discordapp.net",
//"images-ext-2.discordapp.net",
//"images-ext-1.discordapp.net",
//},
//DomainTag = DomainTag.DiscordNet,
//IsEnable= false,
//},
new ProxyDomainModel{
Name=Resources.TwitchChat,
Domains = new List<string>{ "irc-ws.chat.twitch.tv" },
Expand Down

0 comments on commit 686e398

Please sign in to comment.