Skip to content

Commit

Permalink
Disable Nagle for proxied connections
Browse files Browse the repository at this point in the history
Most of the proxy stuff will be latency sensitive traffic so we
disable Nagle because it introduces delays.
  • Loading branch information
samhed committed Jun 2, 2016
1 parent 192ec6f commit f23780e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions websockify/websocketproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ def new_websocket_client(self):
self.server.target_port,
connect=True, use_ssl=self.server.ssl_target, unix_socket=self.server.unix_target)

self.request.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1)
if not self.server.wrap_cmd and not self.server.unix_target:
tsock.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1)

self.print_traffic(self.traffic_legend)

# Start proxying
Expand Down

0 comments on commit f23780e

Please sign in to comment.