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
5a8ad851
Commit
5a8ad851
authored
May 15, 2017
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print server connections for debugging
parent
d1e52fa5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
ProxyTestController.cs
.../Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
+5
-3
No files found.
Examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
View file @
5a8ad851
...
...
@@ -106,7 +106,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
//intecept & cancel redirect or update requests
public
async
Task
OnRequest
(
object
sender
,
SessionEventArgs
e
)
{
Console
.
WriteLine
(
"Active Connections:"
+
(
sender
as
ProxyServer
).
ClientConnectionCount
);
Console
.
WriteLine
(
"Active C
lient C
onnections:"
+
(
sender
as
ProxyServer
).
ClientConnectionCount
);
Console
.
WriteLine
(
e
.
WebSession
.
Request
.
Url
);
//read request headers
...
...
@@ -149,7 +149,9 @@ namespace Titanium.Web.Proxy.Examples.Basic
//Modify response
public
async
Task
OnResponse
(
object
sender
,
SessionEventArgs
e
)
{
if
(
requestBodyHistory
.
ContainsKey
(
e
.
Id
))
Console
.
WriteLine
(
"Active Server Connections:"
+
(
sender
as
ProxyServer
).
ServerConnectionCount
);
if
(
requestBodyHistory
.
ContainsKey
(
e
.
Id
))
{
//access request body by looking up the shared dictionary using requestId
var
requestBody
=
requestBodyHistory
[
e
.
Id
];
...
...
@@ -159,7 +161,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
var
responseHeaders
=
e
.
WebSession
.
Response
.
ResponseHeaders
;
// print out process id of current session
Console
.
WriteLine
(
$"PID:
{
e
.
WebSession
.
ProcessId
.
Value
}
"
);
//
Console.WriteLine($"PID: {e.WebSession.ProcessId.Value}");
//if (!e.ProxySession.Request.Host.Equals("medeczane.sgk.gov.tr")) return;
if
(
e
.
WebSession
.
Request
.
Method
==
"GET"
||
e
.
WebSession
.
Request
.
Method
==
"POST"
)
...
...
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