add TCP_NODELAY
This commit is contained in:
parent
480c9ec51e
commit
e8454cf9b1
2 changed files with 2 additions and 0 deletions
1
local.py
1
local.py
|
@ -134,6 +134,7 @@ class Socks5Server(SocketServer.StreamRequestHandler):
|
||||||
remote = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
|
remote = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
|
||||||
else:
|
else:
|
||||||
remote = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
remote = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
remote.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
||||||
remote.connect((SERVER, REMOTE_PORT))
|
remote.connect((SERVER, REMOTE_PORT))
|
||||||
self.send_encrypt(remote, addr_to_send)
|
self.send_encrypt(remote, addr_to_send)
|
||||||
logging.info('connecting %s:%d' % (addr, port[0]))
|
logging.info('connecting %s:%d' % (addr, port[0]))
|
||||||
|
|
|
@ -112,6 +112,7 @@ class Socks5Server(SocketServer.StreamRequestHandler):
|
||||||
try:
|
try:
|
||||||
logging.info('connecting %s:%d' % (addr, port[0]))
|
logging.info('connecting %s:%d' % (addr, port[0]))
|
||||||
remote = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
remote = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
remote.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
||||||
remote.connect((addr, port[0]))
|
remote.connect((addr, port[0]))
|
||||||
except socket.error, e:
|
except socket.error, e:
|
||||||
# Connection refused
|
# Connection refused
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue