Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Titanium-Web-Proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Titanium-Web-Proxy
Commits
8317c222
Commit
8317c222
authored
May 15, 2017
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update sample proj for convenience (don't block google, evade dropbox)
parent
cac97495
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
ProxyTestController.cs
.../Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
+19
-19
No files found.
Examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
View file @
8317c222
...
...
@@ -47,7 +47,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
//Exclude Https addresses you don't want to proxy
//Useful for clients that use certificate pinning
//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)
//for example github.com
...
...
@@ -127,24 +127,24 @@ namespace Titanium.Web.Proxy.Examples.Basic
requestBodyHistory
[
e
.
Id
]
=
bodyString
;
}
//To cancel a request with a custom HTML content
//Filter URL
if
(
e
.
WebSession
.
Request
.
RequestUri
.
AbsoluteUri
.
Contains
(
"google.com"
))
{
await
e
.
Ok
(
"<!DOCTYPE html>"
+
"<html><body><h1>"
+
"Website Blocked"
+
"</h1>"
+
"<p>Blocked by titanium web proxy.</p>"
+
"</body>"
+
"</html>"
);
}
//Redirect example
if
(
e
.
WebSession
.
Request
.
RequestUri
.
AbsoluteUri
.
Contains
(
"wikipedia.org"
))
{
await
e
.
Redirect
(
"https://www.paypal.com"
);
}
//
//
To cancel a request with a custom HTML content
//
//
Filter URL
//
if (e.WebSession.Request.RequestUri.AbsoluteUri.Contains("google.com"))
//
{
//
await e.Ok("<!DOCTYPE html>" +
//
"<html><body><h1>" +
//
"Website Blocked" +
//
"</h1>" +
//
"<p>Blocked by titanium web proxy.</p>" +
//
"</body>" +
//
"</html>");
//
}
//
//
Redirect example
//
if (e.WebSession.Request.RequestUri.AbsoluteUri.Contains("wikipedia.org"))
//
{
//
await e.Redirect("https://www.paypal.com");
//
}
}
//Modify response
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment