Do not hang on non-ready client connection.
Wait 3 seconds for the client to send something. If no data is available within 3 seconds then close the connection. It's probably a non-WebSockets client that is waiting for the server to say something first.
This commit is contained in:
+4
-1
@@ -160,7 +160,10 @@ Traffic Legend:
|
||||
try:
|
||||
self.do_proxy(client, tsock)
|
||||
except:
|
||||
if tsock: tsock.close()
|
||||
if tsock:
|
||||
tsock.close()
|
||||
self.vmsg("%s:%s: Target closed" %(
|
||||
self.target_host, self.target_port))
|
||||
if self.rec:
|
||||
self.rec.write("'EOF']\n")
|
||||
self.rec.close()
|
||||
|
||||
Reference in New Issue
Block a user