diff --git a/packaging/package.net472.ps1 b/packaging/package.net472.ps1 index c3a55bb2ff4..0fcd3d93093 100644 --- a/packaging/package.net472.ps1 +++ b/packaging/package.net472.ps1 @@ -8,7 +8,7 @@ $result = 'Steam++' $bin = '..\source\SteamTools\bin\x86\Release\' # '*.exe.config' - $targetKeywords = '*.exe','*.dll','*.txt','*.VisualElementsManifest.xml','*.pak','*.bin','*.js' + $targetKeywords = '*.exe','*.dll','*.txt','*.VisualElementsManifest.xml','*.pak','*.bin','*.js','Log4net.config' $ignoreKeywords = '*.vshost.*','Microsoft.*.resources.dll','ExPlugin.*.dll' $exeSource = '\Steam++.exe' diff --git a/source/SteamTool.Proxy/HttpProxy.cs b/source/SteamTool.Proxy/HttpProxy.cs index 40bea23e47c..4c83a32bdef 100644 --- a/source/SteamTool.Proxy/HttpProxy.cs +++ b/source/SteamTool.Proxy/HttpProxy.cs @@ -75,7 +75,7 @@ public async Task OnRequest(object sender, SessionEventArgs e) #endregion Debug.WriteLine("OnRequest " + e.HttpClient.Request.RequestUri.AbsoluteUri); Debug.WriteLine("OnRequest HTTP " + e.HttpClient.Request.HttpVersion); - Logger.Info("OnRequest" + e.HttpClient.Request.RequestUri.AbsoluteUri); + //Logger.Info("OnRequest" + e.HttpClient.Request.RequestUri.AbsoluteUri); #endif // Dns.GetHostAddressesAsync(e.HttpClient.Request.Host).ContinueWith(s => //{ @@ -87,6 +87,7 @@ public async Task OnRequest(object sender, SessionEventArgs e) // return; // } //}); + //Logger.Info("Steam++ OnRequest: " + e.HttpClient.Request.RequestUri.AbsoluteUri); foreach (var item in ProxyDomains) { if (!item.IsEnable) @@ -97,6 +98,10 @@ public async Task OnRequest(object sender, SessionEventArgs e) { if (e.HttpClient.Request.RequestUri.AbsoluteUri.Contains(host)) { + if (e.HttpClient.Request.RequestUri.Scheme == "http") + { + e.Redirect(e.HttpClient.Request.RequestUri.AbsoluteUri.Remove(0, 4).Insert(0, "https")); + } IPAddress iP = null; if (!string.IsNullOrEmpty(item.ProxyIPAddres)) { @@ -106,6 +111,7 @@ public async Task OnRequest(object sender, SessionEventArgs e) { var iPs = await Dns.GetHostAddressesAsync(item.ToDomain); iP = iPs.FirstOrDefault(); + //Logger.Info("Proxy IP: " + iP); } if (iP != null) { @@ -113,6 +119,7 @@ public async Task OnRequest(object sender, SessionEventArgs e) } if (e.HttpClient.ConnectRequest?.ClientHelloInfo != null) { + //Logger.Info("ClientHelloInfo Info: " + e.HttpClient.ConnectRequest.ClientHelloInfo); if (!string.IsNullOrEmpty(item.ServerName)) { var sni = e.HttpClient.ConnectRequest.ClientHelloInfo.Extensions["server_name"]; @@ -255,11 +262,11 @@ public bool SetupCertificate() //proxyServer.CertificateManager.CertificateEngine = Network.CertificateEngine.BouncyCastle; //proxyServer.CertificateManager.SaveFakeCertificates = true; var result = proxyServer.CertificateManager.CreateRootCertificate(true); - if (result) - { - proxyServer.CertificateManager.EnsureRootCertificate(); - proxyServer.CertificateManager.RootCertificate.SaveCerCertificateFile(Path.Combine(AppContext.BaseDirectory, $@"{CertificateName}.Certificate.cer")); - } + //if (result) + //{ + proxyServer.CertificateManager.EnsureRootCertificate(); + proxyServer.CertificateManager.RootCertificate.SaveCerCertificateFile(Path.Combine(AppContext.BaseDirectory, $@"{CertificateName}.Certificate.cer")); + //} return IsCertificateInstalled(proxyServer.CertificateManager.RootCertificate); } @@ -373,7 +380,11 @@ public bool StartProxy(bool IsProxyGOG = false) //GenericCertificate = proxyServer.CertificateManager.RootCertificate }; proxyServer.AddEndPoint(transparentEndPoint); - + var transparentEndPoint80 = new TransparentProxyEndPoint(IPAddress.Any, 80, true) + { + //GenericCertificate = proxyServer.CertificateManager.RootCertificate + }; + proxyServer.AddEndPoint(transparentEndPoint80); proxyServer.ExceptionFunc = ((Exception exception) => { Logger.Error(exception); diff --git a/source/SteamTools/Services/ProxyService.cs b/source/SteamTools/Services/ProxyService.cs index 81e4d73ab77..2ce57deffec 100644 --- a/source/SteamTools/Services/ProxyService.cs +++ b/source/SteamTools/Services/ProxyService.cs @@ -68,8 +68,8 @@ public void Initialize() new ProxyDomainModel{ Name=Resources.SteamImage, Domains = new List{"steamcdn-a.akamaihd.net" }, -//ToDomain = "cdn.akamai.steamstatic.com", -ToDomain = "media.steampowered.com", +ToDomain = "cdn.akamai.steamstatic.com", +//ToDomain = "media.steampowered.com", Hosts = new List{ "steamcdn-a.akamaihd.net"}, DomainTag = DomainTag.SteamImage, IsEnable= false, diff --git a/source/SteamTools/SteamTools.csproj b/source/SteamTools/SteamTools.csproj index 1ba725eea65..5765047c5a7 100644 --- a/source/SteamTools/SteamTools.csproj +++ b/source/SteamTools/SteamTools.csproj @@ -35,7 +35,7 @@ - 1.0.5 + 1.0.6 false