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
3e7c8499
Commit
3e7c8499
authored
Jul 21, 2019
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
write to console enabled again in proxytestcontroller
parent
b376227a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
ProxyTestController.cs
.../Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
+4
-4
WinCertificateMaker.cs
...nium.Web.Proxy/Network/Certificate/WinCertificateMaker.cs
+1
-1
CertificateManager.cs
src/Titanium.Web.Proxy/Network/CertificateManager.cs
+1
-1
TcpConnectionFactory.cs
src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
+1
-1
No files found.
examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
View file @
3e7c8499
...
@@ -119,7 +119,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
...
@@ -119,7 +119,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
private
async
Task
onBeforeTunnelConnectRequest
(
object
sender
,
TunnelConnectSessionEventArgs
e
)
private
async
Task
onBeforeTunnelConnectRequest
(
object
sender
,
TunnelConnectSessionEventArgs
e
)
{
{
string
hostname
=
e
.
HttpClient
.
Request
.
RequestUri
.
Host
;
string
hostname
=
e
.
HttpClient
.
Request
.
RequestUri
.
Host
;
//
await writeToConsole("Tunnel to: " + hostname);
await
writeToConsole
(
"Tunnel to: "
+
hostname
);
if
(
hostname
.
Contains
(
"dropbox.com"
))
if
(
hostname
.
Contains
(
"dropbox.com"
))
{
{
...
@@ -138,8 +138,8 @@ namespace Titanium.Web.Proxy.Examples.Basic
...
@@ -138,8 +138,8 @@ namespace Titanium.Web.Proxy.Examples.Basic
// intecept & cancel redirect or update requests
// intecept & cancel redirect or update requests
private
async
Task
onRequest
(
object
sender
,
SessionEventArgs
e
)
private
async
Task
onRequest
(
object
sender
,
SessionEventArgs
e
)
{
{
//
await writeToConsole("Active Client Connections:" + ((ProxyServer)sender).ClientConnectionCount);
await
writeToConsole
(
"Active Client Connections:"
+
((
ProxyServer
)
sender
).
ClientConnectionCount
);
//
await writeToConsole(e.HttpClient.Request.Url);
await
writeToConsole
(
e
.
HttpClient
.
Request
.
Url
);
// store it in the UserData property
// store it in the UserData property
// It can be a simple integer, Guid, or any type
// It can be a simple integer, Guid, or any type
...
@@ -189,7 +189,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
...
@@ -189,7 +189,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
private
async
Task
onResponse
(
object
sender
,
SessionEventArgs
e
)
private
async
Task
onResponse
(
object
sender
,
SessionEventArgs
e
)
{
{
//
await writeToConsole("Active Server Connections:" + ((ProxyServer)sender).ServerConnectionCount);
await
writeToConsole
(
"Active Server Connections:"
+
((
ProxyServer
)
sender
).
ServerConnectionCount
);
string
ext
=
System
.
IO
.
Path
.
GetExtension
(
e
.
HttpClient
.
Request
.
RequestUri
.
AbsolutePath
);
string
ext
=
System
.
IO
.
Path
.
GetExtension
(
e
.
HttpClient
.
Request
.
RequestUri
.
AbsolutePath
);
...
...
src/Titanium.Web.Proxy/Network/Certificate/WinCertificateMaker.cs
View file @
3e7c8499
...
@@ -105,8 +105,8 @@ namespace Titanium.Web.Proxy.Network.Certificate
...
@@ -105,8 +105,8 @@ namespace Titanium.Web.Proxy.Network.Certificate
// KeyLength
// KeyLength
const
int
keyLength
=
2048
;
const
int
keyLength
=
2048
;
var
graceTime
=
DateTime
.
Now
.
AddDays
(
graceDays
);
var
now
=
DateTime
.
Now
;
var
now
=
DateTime
.
Now
;
var
graceTime
=
now
.
AddDays
(
graceDays
);
var
certificate
=
makeCertificate
(
isRoot
,
sSubjectCN
,
fullSubject
,
keyLength
,
hashAlgo
,
graceTime
,
var
certificate
=
makeCertificate
(
isRoot
,
sSubjectCN
,
fullSubject
,
keyLength
,
hashAlgo
,
graceTime
,
now
.
AddDays
(
validDays
),
isRoot
?
null
:
signingCert
);
now
.
AddDays
(
validDays
),
isRoot
?
null
:
signingCert
);
return
certificate
;
return
certificate
;
...
...
src/Titanium.Web.Proxy/Network/CertificateManager.cs
View file @
3e7c8499
...
@@ -483,7 +483,7 @@ namespace Titanium.Web.Proxy.Network
...
@@ -483,7 +483,7 @@ namespace Titanium.Web.Proxy.Network
var
cancellationToken
=
clearCertificatesTokenSource
.
Token
;
var
cancellationToken
=
clearCertificatesTokenSource
.
Token
;
while
(!
cancellationToken
.
IsCancellationRequested
)
while
(!
cancellationToken
.
IsCancellationRequested
)
{
{
var
cutOff
=
DateTime
.
Now
.
AddMinutes
(-
1
*
CertificateCacheTimeOutMinutes
);
var
cutOff
=
DateTime
.
Now
.
AddMinutes
(-
CertificateCacheTimeOutMinutes
);
var
outdated
=
cachedCertificates
.
Where
(
x
=>
x
.
Value
.
LastAccess
<
cutOff
).
ToList
();
var
outdated
=
cachedCertificates
.
Where
(
x
=>
x
.
Value
.
LastAccess
<
cutOff
).
ToList
();
...
...
src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
View file @
3e7c8499
...
@@ -480,7 +480,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
...
@@ -480,7 +480,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
{
{
try
try
{
{
var
cutOff
=
DateTime
.
Now
.
AddSeconds
(-
1
*
Server
.
ConnectionTimeOutSeconds
);
var
cutOff
=
DateTime
.
Now
.
AddSeconds
(-
Server
.
ConnectionTimeOutSeconds
);
foreach
(
var
item
in
cache
)
foreach
(
var
item
in
cache
)
{
{
var
queue
=
item
.
Value
;
var
queue
=
item
.
Value
;
...
...
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