Skip to content
This repository was archived by the owner on Jan 13, 2020. It is now read-only.

Commit 06054b1

Browse files
committed
backported max_clients
1 parent 7ecab27 commit 06054b1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

config_webrx.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#Server settings
2525
web_port=8073
2626
server_hostname="localhost" # If this contains an incorrect value, the web UI may freeze on load (it can't open websocket)
27+
max_clients=20
2728

2829
#Web GUI configuration
2930
receiver_name="[Callsign]"

openwebrx.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def cleanup_clients():
202202
for i in range(0,len(clients)):
203203
i-=correction
204204
#print "cleanup_clients:: len(clients)=", len(clients), "i=", i
205-
if (not clients[i].ws_started) and (time.time()-clients[i].gen_time)>180:
205+
if (not clients[i].ws_started) and (time.time()-clients[i].gen_time)>45:
206206
print "[openwebrx] cleanup_clients :: client timeout to open WebSocket"
207207
close_client(i, False)
208208
correction+=1
@@ -385,6 +385,14 @@ def do_GET(self):
385385
self.end_headers()
386386
self.wfile.write("<html><body><h1>Object moved</h1>Please <a href=\"/upgrade.html\">click here</a> to continue.</body></html>")
387387
return
388+
if extension == "wrx": cleanup_clients()
389+
if extension == "wrx" and cfg.max_clients<=len(clients):
390+
self.send_response(302) #backported max_clients fix
391+
self.send_header('Content-type','text/html')
392+
self.send_header("Location", "http://{0}:{1}/retry.html".format(cfg.server_hostname,cfg.web_port))
393+
self.end_headers()
394+
self.wfile.write("<html><body><h1>Object moved</h1>Please <a href=\"/retry.html\">click here</a> to continue.</body></html>")
395+
return
388396
self.send_response(200)
389397
if(("wrx","html","htm").count(extension)):
390398
self.send_header('Content-type','text/html')

0 commit comments

Comments
 (0)