Commit 8317c222 authored by justcoding121's avatar justcoding121

update sample proj for convenience (don't block google, evade dropbox)

parent cac97495
...@@ -47,7 +47,7 @@ namespace Titanium.Web.Proxy.Examples.Basic ...@@ -47,7 +47,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
//Exclude Https addresses you don't want to proxy //Exclude Https addresses you don't want to proxy
//Useful for clients that use certificate pinning //Useful for clients that use certificate pinning
//for example google.com and dropbox.com //for example google.com and dropbox.com
// ExcludedHttpsHostNameRegex = new List<string>() { "google.com", "dropbox.com" } ExcludedHttpsHostNameRegex = new List<string>() { "dropbox.com" }
//Include Https addresses you want to proxy (others will be excluded) //Include Https addresses you want to proxy (others will be excluded)
//for example github.com //for example github.com
...@@ -127,24 +127,24 @@ namespace Titanium.Web.Proxy.Examples.Basic ...@@ -127,24 +127,24 @@ namespace Titanium.Web.Proxy.Examples.Basic
requestBodyHistory[e.Id] = bodyString; requestBodyHistory[e.Id] = bodyString;
} }
//To cancel a request with a custom HTML content ////To cancel a request with a custom HTML content
//Filter URL ////Filter URL
if (e.WebSession.Request.RequestUri.AbsoluteUri.Contains("google.com")) //if (e.WebSession.Request.RequestUri.AbsoluteUri.Contains("google.com"))
{ //{
await e.Ok("<!DOCTYPE html>" + // await e.Ok("<!DOCTYPE html>" +
"<html><body><h1>" + // "<html><body><h1>" +
"Website Blocked" + // "Website Blocked" +
"</h1>" + // "</h1>" +
"<p>Blocked by titanium web proxy.</p>" + // "<p>Blocked by titanium web proxy.</p>" +
"</body>" + // "</body>" +
"</html>"); // "</html>");
} //}
//Redirect example ////Redirect example
if (e.WebSession.Request.RequestUri.AbsoluteUri.Contains("wikipedia.org")) //if (e.WebSession.Request.RequestUri.AbsoluteUri.Contains("wikipedia.org"))
{ //{
await e.Redirect("https://www.paypal.com"); // await e.Redirect("https://www.paypal.com");
} //}
} }
//Modify response //Modify response
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment