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
5d23aeff
Commit
5d23aeff
authored
Aug 26, 2019
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPv6 fix
parent
2eed8cb0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
16 deletions
+22
-16
TcpConnectionFactory.cs
src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
+21
-15
ProxyServer.cs
src/Titanium.Web.Proxy/ProxyServer.cs
+1
-1
No files found.
src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
View file @
5d23aeff
...
...
@@ -71,7 +71,6 @@ namespace Titanium.Web.Proxy.Network.Tcp
cacheKeyBuilder
.
Append
(
externalProxy
!=
null
?
$"
{
externalProxy
.
GetCacheKey
()}
-"
:
string
.
Empty
);
return
cacheKeyBuilder
.
ToString
();
}
/// <summary>
...
...
@@ -280,20 +279,6 @@ namespace Titanium.Web.Proxy.Network.Tcp
retry
:
try
{
tcpClient
=
new
TcpClient
(
upStreamEndPoint
)
{
NoDelay
=
proxyServer
.
NoDelay
,
ReceiveTimeout
=
proxyServer
.
ConnectionTimeOutSeconds
*
1000
,
SendTimeout
=
proxyServer
.
ConnectionTimeOutSeconds
*
1000
,
LingerState
=
new
LingerOption
(
true
,
proxyServer
.
TcpTimeWaitSeconds
)
};
// linux has a bug with socket reuse in .net core.
if
(
proxyServer
.
ReuseSocket
&&
RunTime
.
IsWindows
)
{
tcpClient
.
Client
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
ReuseAddress
,
true
);
}
var
hostname
=
useUpstreamProxy
?
externalProxy
.
HostName
:
remoteHostName
;
var
port
=
useUpstreamProxy
?
externalProxy
.
Port
:
remotePort
;
...
...
@@ -312,6 +297,27 @@ namespace Titanium.Web.Proxy.Network.Tcp
{
try
{
var
ipAddress
=
ipAddresses
[
i
];
if
(
upStreamEndPoint
==
null
)
{
tcpClient
=
new
TcpClient
(
ipAddress
.
AddressFamily
);
}
else
{
tcpClient
=
new
TcpClient
(
upStreamEndPoint
);
}
tcpClient
.
NoDelay
=
proxyServer
.
NoDelay
;
tcpClient
.
ReceiveTimeout
=
proxyServer
.
ConnectionTimeOutSeconds
*
1000
;
tcpClient
.
SendTimeout
=
proxyServer
.
ConnectionTimeOutSeconds
*
1000
;
tcpClient
.
LingerState
=
new
LingerOption
(
true
,
proxyServer
.
TcpTimeWaitSeconds
);
// linux has a bug with socket reuse in .net core.
if
(
proxyServer
.
ReuseSocket
&&
RunTime
.
IsWindows
)
{
tcpClient
.
Client
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
ReuseAddress
,
true
);
}
await
tcpClient
.
ConnectAsync
(
ipAddresses
[
i
],
port
);
break
;
}
...
...
src/Titanium.Web.Proxy/ProxyServer.cs
View file @
5d23aeff
...
...
@@ -268,7 +268,7 @@ namespace Titanium.Web.Proxy
/// Local adapter/NIC endpoint where proxy makes request via.
/// Defaults via any IP addresses of this machine.
/// </summary>
public
IPEndPoint
UpStreamEndPoint
{
get
;
set
;
}
=
new
IPEndPoint
(
IPAddress
.
Any
,
0
);
public
IPEndPoint
UpStreamEndPoint
{
get
;
set
;
}
/// <summary>
/// A list of IpAddress and port this proxy is listening to.
...
...
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