public override void ProcessHelpPageRequest(HttpContext context) { using (var stream = GetType().Assembly.GetManifestResourceStream("Microsoft.PythonTools.WebRole.WebSocketProxy.html")) using (var reader = new StreamReader(stream)) { string html = reader.ReadToEnd(); var wsUri = new UriBuilder(context.Request.Url) { Scheme = "wss", Port = -1, UserName = "******" }.ToString(); wsUri = wsUri.Replace("secret@", "<span class='secret'>secret</span>@"); context.Response.Write(html.Replace("{{WS_URI}}", wsUri)); context.Response.End(); } }
internal IEnumerable<string> GetPrefixes() { foreach (var baseUri in this.baseUriList) { var prefix = new UriBuilder(baseUri).ToString(); if (this.configuration.RewriteLocalhost && !baseUri.Host.Contains(".")) { prefix = prefix.Replace("localhost", "+"); } yield return prefix; } }
private IEnumerable<string> GetPrefixes() { foreach (var baseUri in _baseUriList) { var prefix = new UriBuilder(baseUri).ToString(); bool rewriteLocalhost = true; if (rewriteLocalhost && !baseUri.Host.Contains(".")) { prefix = prefix.Replace("localhost", "+"); } yield return prefix; } }