Commit fcedf559 authored by titanium007's avatar titanium007

Update README.md

parent 29055e6e
......@@ -22,7 +22,7 @@ Install by nuget:
Install-Package Titanium.Web.Proxy -Pre
After installing nuget package mark following files to be copy to output directory
After installing nuget package mark following files to be copied 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.GetResponseBody();
string responseHtmlBody = e.GetResponseHtmlBody();
//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);
}
}
}
......
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