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
5acb2ff4
Commit
5acb2ff4
authored
Jul 31, 2018
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update linger time default to 30 seconds
parent
ae7ef96b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
27 deletions
+22
-27
TcpConnectionFactory.cs
Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
+2
-1
ProxyServer.cs
Titanium.Web.Proxy/ProxyServer.cs
+20
-26
No files found.
Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
View file @
5acb2ff4
...
...
@@ -276,7 +276,8 @@ namespace Titanium.Web.Proxy.Network.Tcp
LingerState
=
new
LingerOption
(
true
,
proxyServer
.
TcpTimeWaitSeconds
)
};
if
(
proxyServer
.
ReuseSocket
)
//linux has a bug with socket reuse in .net core.
if
(
proxyServer
.
ReuseSocket
&&
!
RunTime
.
IsLinux
)
{
tcpClient
.
Client
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
ReuseAddress
,
true
);
}
...
...
Titanium.Web.Proxy/ProxyServer.cs
View file @
5acb2ff4
...
...
@@ -109,12 +109,6 @@ namespace Titanium.Web.Proxy
systemProxySettingsManager
=
new
SystemProxyManager
();
}
//linux have bug with socket reuse
if
(!
RunTime
.
IsLinux
)
{
ReuseSocket
=
true
;
}
CertificateManager
=
new
CertificateManager
(
rootCertificateName
,
rootCertificateIssuerName
,
userTrustRootCertificate
,
machineTrustRootCertificate
,
trustRootCertificateAsAdmin
,
ExceptionFunc
);
}
...
...
@@ -184,7 +178,6 @@ namespace Titanium.Web.Proxy
/// </summary>
public
int
ConnectionTimeOutSeconds
{
get
;
set
;
}
/// <summary>
/// Maximum number of concurrent connections per remote host in cache.
/// Only valid when connection pooling is enabled.
...
...
@@ -194,15 +187,15 @@ namespace Titanium.Web.Proxy
/// <summary>
/// Number of seconds to linger when Tcp connection is in TIME_WAIT state.
/// Default value is 3.
/// Default value is 3
0
.
/// </summary>
public
int
TcpTimeWaitSeconds
{
get
;
set
;
}
=
3
;
public
int
TcpTimeWaitSeconds
{
get
;
set
;
}
=
3
0
;
/// <summary>
/// Should we re
sues
client/server tcp sockets.
/// Should we re
use
client/server tcp sockets.
/// Default is true (false for linux due to bug in .Net core).
/// </summary>
public
bool
ReuseSocket
{
get
;
set
;
}
public
bool
ReuseSocket
{
get
;
set
;
}
=
true
;
/// <summary>
/// Total number of active client connections.
...
...
@@ -300,20 +293,6 @@ namespace Titanium.Web.Proxy
/// </summary>
public
IEnumerable
<
string
>
ProxyAuthenticationSchemes
{
get
;
set
;
}
=
new
string
[
0
];
/// <summary>
/// Dispose the Proxy instance.
/// </summary>
public
void
Dispose
()
{
if
(
ProxyRunning
)
{
Stop
();
}
CertificateManager
?.
Dispose
();
BufferPool
?.
Dispose
();
}
/// <summary>
/// Event occurs when client connection count changed.
/// </summary>
...
...
@@ -638,7 +617,8 @@ namespace Titanium.Web.Proxy
{
endPoint
.
Listener
=
new
TcpListener
(
endPoint
.
IpAddress
,
endPoint
.
Port
);
if
(
ReuseSocket
)
//linux has a bug with socket reuse in .net core.
if
(
ReuseSocket
&&
!
RunTime
.
IsLinux
)
{
endPoint
.
Listener
.
Server
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
ReuseAddress
,
true
);
}
...
...
@@ -849,5 +829,19 @@ namespace Titanium.Web.Proxy
{
return
new
RetryPolicy
<
T
>(
retries
,
tcpConnectionFactory
);
}
/// <summary>
/// Dispose the Proxy instance.
/// </summary>
public
void
Dispose
()
{
if
(
ProxyRunning
)
{
Stop
();
}
CertificateManager
?.
Dispose
();
BufferPool
?.
Dispose
();
}
}
}
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