Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #892 from kokeiro001/fix_readme_code
Browse files Browse the repository at this point in the history
fix readme code
  • Loading branch information
honfika committed Dec 19, 2021
2 parents 400ca56 + 1197779 commit 2825191
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Any, 8000, true)
};

// Fired when a CONNECT request is received
explicitEndPoint.BeforeTunnelConnect += OnBeforeTunnelConnect;
explicitEndPoint.BeforeTunnelConnectRequest += OnBeforeTunnelConnectRequest;

// An explicit endpoint is where the client knows about the existence of a proxy
// So client sends request in a proxy friendly manner
Expand Down Expand Up @@ -127,7 +127,7 @@ proxyServer.SetAsSystemHttpsProxy(explicitEndPoint);
Console.Read();

// Unsubscribe & Quit
explicitEndPoint.BeforeTunnelConnect -= OnBeforeTunnelConnect;
explicitEndPoint.BeforeTunnelConnectRequest -= OnBeforeTunnelConnectRequest;
proxyServer.BeforeRequest -= OnRequest;
proxyServer.BeforeResponse -= OnResponse;
proxyServer.ServerCertificateValidationCallback -= OnCertificateValidation;
Expand Down Expand Up @@ -158,7 +158,7 @@ public async Task OnRequest(object sender, SessionEventArgs e)
Console.WriteLine(e.HttpClient.Request.Url);

// read request headers
var requestHeaders = e.HttpClient.Request.RequestHeaders;
var requestHeaders = e.HttpClient.Request.Headers;

var method = e.HttpClient.Request.Method.ToUpper();
if ((method == "POST" || method == "PUT" || method == "PATCH"))
Expand Down Expand Up @@ -200,12 +200,12 @@ public async Task OnRequest(object sender, SessionEventArgs e)
public async Task OnResponse(object sender, SessionEventArgs e)
{
// read response headers
var responseHeaders = e.HttpClient.Response.ResponseHeaders;
var responseHeaders = e.HttpClient.Response.Headers;

//if (!e.ProxySession.Request.Host.Equals("medeczane.sgk.gov.tr")) return;
if (e.HttpClient.Request.Method == "GET" || e.HttpClient.Request.Method == "POST")
{
if (e.HttpClient.Response.ResponseStatusCode == "200")
if (e.HttpClient.Response.StatusCode == 200)
{
if (e.HttpClient.Response.ContentType != null && e.HttpClient.Response.ContentType.Trim().ToLower().Contains("text/html"))
{
Expand Down

0 comments on commit 2825191

Please sign in to comment.