{"action":"created","issue":{"url":"https://api.github.com/repos/justcoding121/Titanium-Web-Proxy/issues/318","repository_url":"https://api.github.com/repos/justcoding121/Titanium-Web-Proxy","labels_url":"https://api.github.com/repos/justcoding121/Titanium-Web-Proxy/issues/318/labels{/name}","comments_url":"https://api.github.com/repos/justcoding121/Titanium-Web-Proxy/issues/318/comments","events_url":"https://api.github.com/repos/justcoding121/Titanium-Web-Proxy/issues/318/events","html_url":"https://github.com/justcoding121/Titanium-Web-Proxy/issues/318","id":259655408,"number":318,"title":"Wrong URI received when using multiple endpoints","user":{"login":"hozuki","id":7345875,"avatar_url":"https://avatars0.githubusercontent.com/u/7345875?v=4","gravatar_id":"","url":"https://api.github.com/users/hozuki","html_url":"https://github.com/hozuki","followers_url":"https://api.github.com/users/hozuki/followers","following_url":"https://api.github.com/users/hozuki/following{/other_user}","gists_url":"https://api.github.com/users/hozuki/gists{/gist_id}","starred_url":"https://api.github.com/users/hozuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hozuki/subscriptions","organizations_url":"https://api.github.com/users/hozuki/orgs","repos_url":"https://api.github.com/users/hozuki/repos","events_url":"https://api.github.com/users/hozuki/events{/privacy}","received_events_url":"https://api.github.com/users/hozuki/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-09-21T22:51:28Z","updated_at":"2018-02-06T06:39:54Z","closed_at":null,"author_association":"NONE","body":"Sample code:\r\n\r\n```csharp\r\nproxyServer.TrustRootCertificate = true;\r\nvar ep1 = new TransparentProxyEndPoint(IPAddress.Any, 80, true);\r\nvar ep2 = new TransparentProxyEndPoint(IPAddress.Any, 443, true);\r\nproxyServer.AddEndPoint(ep1);\r\nproxyServer.AddEndPoint(ep2);\r\nproxyServer.Start();\r\n```\r\n\r\n`OnRequest` (`OnResponse` is similar to this):\r\n\r\n```csharp\r\nConsole.WriteLine(e.WebSession.Request.RequestUri);\r\n```\r\n\r\nAnd then you will see the URIs being printed like:\r\n\r\n```plain\r\nhttps://www.abc.comwww.abc.com/ (without path and/or query)\r\nhttps://www.def.comhttp//www.def.com/g/h?i=j (with path and query)\r\n```"},"comment":{"url":"https://api.github.com/repos/justcoding121/Titanium-Web-Proxy/issues/comments/363325952","html_url":"https://github.com/justcoding121/Titanium-Web-Proxy/issues/318#issuecomment-363325952","issue_url":"https://api.github.com/repos/justcoding121/Titanium-Web-Proxy/issues/318","id":363325952,"user":{"login":"hozuki","id":7345875,"avatar_url":"https://avatars0.githubusercontent.com/u/7345875?v=4","gravatar_id":"","url":"https://api.github.com/users/hozuki","html_url":"https://github.com/hozuki","followers_url":"https://api.github.com/users/hozuki/followers","following_url":"https://api.github.com/users/hozuki/following{/other_user}","gists_url":"https://api.github.com/users/hozuki/gists{/gist_id}","starred_url":"https://api.github.com/users/hozuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hozuki/subscriptions","organizations_url":"https://api.github.com/users/hozuki/orgs","repos_url":"https://api.github.com/users/hozuki/repos","events_url":"https://api.github.com/users/hozuki/events{/privacy}","received_events_url":"https://api.github.com/users/hozuki/received_events","type":"User","site_admin":false},"created_at":"2018-02-06T06:39:54Z","updated_at":"2018-02-06T06:39:54Z","author_association":"NONE","body":"Hi I'm here again. I have time to redo the tests.\r\n\r\nThis time I printed `OriginalUrl` and they are fine:\r\n\r\n```\r\nconfig.uca.cloud.unity3d.com:443\r\napi.uca.cloud.unity3d.com:443\r\ndata.flurry.com:443\r\n```\r\n\r\nAnd some example printed `Url` (from the same startup process):\r\n\r\n```\r\nhttps://config.uca.cloud.unity3d.comconfig.uca.cloud.unity3d.com:443\r\nhttps://api.uca.cloud.unity3d.comapi.uca.cloud.unity3d.com:443\r\nhttps://data.flurry.comdata.flurry.com:443\r\n```\r\n\r\nBy the way, I simply modified `HOSTS` this time and I didn't use a DNS forwarder.\r\n\r\nThanks. @honfika \r\n\r\nSource code (using NuGet package version 3.0.213):\r\n\r\n```csharp\r\n    internal sealed class Program {\r\n\r\n        private static void Main(string[] args) {\r\n            Console.TreatControlCAsInput = true;\r\n\r\n            Console.CancelKeyPress += ConsoleOnCancelKeyPress;\r\n\r\n            var proxy = new ProxyServer();\r\n\r\n            proxy.CertificateEngine = CertificateEngine.BouncyCastle;\r\n            proxy.RootCertificate = new X509Certificate2(\"FiddlerRoot.cer\");\r\n            proxy.CertificateManager.TrustRootCertificate();\r\n\r\n            proxy.AddEndPoint(new TransparentProxyEndPoint(IPAddress.Any, 80, true));\r\n            proxy.AddEndPoint(new TransparentProxyEndPoint(IPAddress.Any, 443, true));\r\n\r\n            proxy.BeforeRequest += ProxyOnBeforeRequest;\r\n\r\n            proxy.Start();\r\n\r\n            while (!_shouldStop) {\r\n                Thread.Sleep(10);\r\n            }\r\n\r\n            proxy.Stop();\r\n\r\n            Console.CancelKeyPress -= ConsoleOnCancelKeyPress;\r\n\r\n            proxy.CertificateManager.RemoveTrustedRootCertificates();\r\n        }\r\n\r\n        private static Task ProxyOnBeforeRequest(object sender, SessionEventArgs e) {\r\n            Console.WriteLine(e.WebSession.Request.Url);\r\n            Debug.Print(e.WebSession.Request.Url);\r\n\r\n            return Task.FromResult(0);\r\n        }\r\n\r\n        private static void ConsoleOnCancelKeyPress(object sender, ConsoleCancelEventArgs e) {\r\n            if (e.SpecialKey == ConsoleSpecialKey.ControlC) {\r\n                e.Cancel = true;\r\n                _shouldStop = true;\r\n            }\r\n        }\r\n\r\n        private static bool _shouldStop;\r\n\r\n    }\r\n```"}}
{"actor":{"display_login":"hozuki"}}