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
6a1b3596
Commit
6a1b3596
authored
Jul 08, 2015
by
justcoding121
Committed by
justcoding121
Jul 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
5b255285
Hide 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 @
6a1b3596
...
@@ -22,7 +22,7 @@ Install by nuget:
...
@@ -22,7 +22,7 @@ Install by nuget:
Install-Package Titanium.Web.Proxy -Pre
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
*
makecert.exe
*
Titanium_Proxy_Test_Root.cer
*
Titanium_Proxy_Test_Root.cer
...
@@ -66,11 +66,14 @@ Sample request and response event handlers
...
@@ -66,11 +66,14 @@ Sample request and response event handlers
```
csharp
```
csharp
public
void
OnRequest
(
object
sender
,
SessionEventArgs
e
)
public
void
OnRequest
(
object
sender
,
SessionEventArgs
e
)
{
{
//Modify e.ProxyRequest
//To cancel a request with a custom HTML content
//Filter URL
//e.Ok("Request Cance
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
)
public
void
OnResponse
(
object
sender
,
SessionEventArgs
e
)
{
{
...
@@ -79,9 +82,11 @@ Sample request and response event handlers
...
@@ -79,9 +82,11 @@ Sample request and response event handlers
if
(
e
.
ServerResponse
.
ContentType
.
Trim
().
ToLower
().
Contains
(
"text/html"
))
if
(
e
.
ServerResponse
.
ContentType
.
Trim
().
ToLower
().
Contains
(
"text/html"
))
{
{
//Get response body
//Get response body
e
.
GetResponse
Body
();
string
responseHtmlBody
=
e
.
GetResponseHtml
Body
();
//Modify e.ServerResponse
//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