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

Commit 2825191

Browse files
authored
Merge pull request #892 from kokeiro001/fix_readme_code
fix readme code
2 parents 400ca56 + 1197779 commit 2825191

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Any, 8000, true)
9393
};
9494

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

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

129129
// Unsubscribe & Quit
130-
explicitEndPoint.BeforeTunnelConnect -= OnBeforeTunnelConnect;
130+
explicitEndPoint.BeforeTunnelConnectRequest -= OnBeforeTunnelConnectRequest;
131131
proxyServer.BeforeRequest -= OnRequest;
132132
proxyServer.BeforeResponse -= OnResponse;
133133
proxyServer.ServerCertificateValidationCallback -= OnCertificateValidation;
@@ -158,7 +158,7 @@ public async Task OnRequest(object sender, SessionEventArgs e)
158158
Console.WriteLine(e.HttpClient.Request.Url);
159159

160160
// read request headers
161-
var requestHeaders = e.HttpClient.Request.RequestHeaders;
161+
var requestHeaders = e.HttpClient.Request.Headers;
162162

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

205205
//if (!e.ProxySession.Request.Host.Equals("medeczane.sgk.gov.tr")) return;
206206
if (e.HttpClient.Request.Method == "GET" || e.HttpClient.Request.Method == "POST")
207207
{
208-
if (e.HttpClient.Response.ResponseStatusCode == "200")
208+
if (e.HttpClient.Response.StatusCode == 200)
209209
{
210210
if (e.HttpClient.Response.ContentType != null && e.HttpClient.Response.ContentType.Trim().ToLower().Contains("text/html"))
211211
{

0 commit comments

Comments
 (0)