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
fcedf559
Commit
fcedf559
authored
Jul 08, 2015
by
titanium007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
29055e6e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
README.md
README.md
+13
-8
No files found.
README.md
View file @
fcedf559
...
...
@@ -22,7 +22,7 @@ Install by nuget:
Install-Package Titanium.Web.Proxy -Pre
After installing nuget package mark following files to be cop
y to output
directory
After installing nuget package mark following files to be cop
ied to app
directory
*
makecert.exe
*
Titanium_Proxy_Test_Root.cer
...
...
@@ -67,9 +67,12 @@ Sample request and response event handlers
public
void
OnRequest
(
object
sender
,
SessionEventArgs
e
)
{
//Modify e.ProxyRequest
//e.Ok("Request Cance
//To cancel a request with a custom HTML content
//Filter URL
if
(
e
.
RequestURL
.
Contains
(
"somewebsite.com"
))
{
e
.
Ok
(
"<!DOCTYPE html><html><body><h1>Blocked</h1><p>website blocked.</p></body></html>"
);
}
}
public
void
OnResponse
(
object
sender
,
SessionEventArgs
e
)
...
...
@@ -79,9 +82,11 @@ Sample request and response event handlers
if
(
e
.
ServerResponse
.
ContentType
.
Trim
().
ToLower
().
Contains
(
"text/html"
))
{
//Get response body
e
.
GetResponse
Body
();
string
responseHtmlBody
=
e
.
GetResponseHtml
Body
();
//Modify e.ServerResponse
e
.
ResponseString
=
"<html><head></head><body>Response is modified!</body></html>"
;
responseHtmlBody
=
"<html><head></head><body>Response is modified!</body></html>"
;
//Set modifed response Html Body
e
.
SetRequestHtmlBody
(
responseHtmlBody
);
}
}
}
...
...
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