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

Commit 7343819

Browse files
committed
nodelay option
1 parent 9028164 commit 7343819

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ private async Task<TcpServerConnection> createServerConnection(string remoteHost
271271
{
272272
tcpClient = new TcpClient(upStreamEndPoint)
273273
{
274-
NoDelay = true,
274+
NoDelay = proxyServer.NoDelay,
275275
ReceiveTimeout = proxyServer.ConnectionTimeOutSeconds * 1000,
276276
SendTimeout = proxyServer.ConnectionTimeOutSeconds * 1000,
277277
SendBufferSize = proxyServer.BufferSize,

src/Titanium.Web.Proxy/ProxyServer.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ public ProxyServer(string rootCertificateName, string rootCertificateIssuerName,
173173
/// </summary>
174174
public bool EnableTcpServerConnectionPrefetch { get; set; } = true;
175175

176+
/// <summary>
177+
/// Gets or sets a Boolean value that specifies whether server and client stream Sockets are using the Nagle algorithm.
178+
/// Defaults to true, no nagle algorithm is used.
179+
/// </summary>
180+
public bool NoDelay { get; set; } = true;
181+
176182
/// <summary>
177183
/// Buffer size in bytes used throughout this proxy.
178184
/// Default value is 8192 bytes.
@@ -696,6 +702,7 @@ private void onAcceptConnection(IAsyncResult asyn)
696702
{
697703
// based on end point type call appropriate request handlers
698704
tcpClient = endPoint.Listener.EndAcceptTcpClient(asyn);
705+
tcpClient.NoDelay = NoDelay;
699706
}
700707
catch (ObjectDisposedException)
701708
{

0 commit comments

Comments
 (0)