From b10e68649d1f16689bd21b2cad9a9eb5f35b5b7e Mon Sep 17 00:00:00 2001 From: Thomas Preece Date: Sun, 4 Jan 2026 13:40:03 +0000 Subject: [PATCH 1/2] Added in ability to use custom server list. Also set connection timeout on iperf --- app.py | 14 ++++++++++---- env.yaml | 7 +++++++ templates/index.html | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index 9494444..878b4ce 100644 --- a/app.py +++ b/app.py @@ -81,9 +81,15 @@ def test(): @app.route("/proxy/iperf3-csv") def proxy_csv(): - url = "https://export.iperf3serverlist.net/maddydev-glitch.csv" - resp = requests.get(url) - return Response(resp.content, content_type="text/csv") + with open("env.yaml") as f: + config = yaml.safe_load(f) + servers = config.get("servers", None) + if servers == None: + url = "https://export.iperf3serverlist.net/maddydev-glitch.csv" + resp = requests.get(url) + return Response(resp.content, content_type="text/csv") + else: + return Response(servers, content_type="text/csv") # @app.route("/set_unit", methods=["POST"]) # def set_unit(): @@ -127,7 +133,7 @@ def run_iperf(): # Run iperf3 in a separate thread to avoid blocking the main thread def start_iperf(): - cmd = ["iperf3", "-c", target, "-p", str(port), "-P", str(streams)] + cmd = ["iperf3", "-c", target, "-p", str(port), "-P", str(streams), "--connect-timeout", "5000"] if protocol == "udp": cmd.append("-u") cmd.append("-b") diff --git a/env.yaml b/env.yaml index b8dec39..067ca5d 100644 --- a/env.yaml +++ b/env.yaml @@ -1,3 +1,10 @@ +# servers: |- +# IP/HOST,PORT,GB/S,CONTINENT,COUNTRY,SITE,PROVIDER +# 37.19.206.20,5201,2x10,"North America",US,Ashburn,DATAPACKET +# 185.152.66.67,5201,2x10,"North America",US,Atlanta,DATAPACKET +# 109.61.86.65,5201,2x10,"North America",US,Boston,DATAPACKET + + logos: # - static/logos/logo1.png # - static/logos/logo2.png diff --git a/templates/index.html b/templates/index.html index ef6c06f..1d2f31f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -114,7 +114,7 @@

iPerf3 Speed Test

- Select Public iPerf3 Server + Select iPerf3 Server
From 1a7e842f56fcf68f85f3d9871c79a2e68defe534 Mon Sep 17 00:00:00 2001 From: Thomas Preece Date: Sun, 4 Jan 2026 13:41:02 +0000 Subject: [PATCH 2/2] Removed empty bubbles and removed sticky header --- static/js/csvPicker.js | 2 +- static/styles.css | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/static/js/csvPicker.js b/static/js/csvPicker.js index 7822852..4c83bc6 100644 --- a/static/js/csvPicker.js +++ b/static/js/csvPicker.js @@ -54,7 +54,7 @@ function populateTable(data) { let dict = {} selected += '
' for (let i = 0; i < headers.length; i++) { - if (headers[i] != "IP/HOST") { + if (headers[i] != "IP/HOST" && row[i].length > 0) { if (headers[i] == "COUNTRY") { const countryCode = row[i].toLowerCase(); // e.g., "dz" selected += `
${headers[i]} : ${row[i]} flag

`; diff --git a/static/styles.css b/static/styles.css index 24bd7d0..3f952a6 100644 --- a/static/styles.css +++ b/static/styles.css @@ -41,7 +41,6 @@ header { backdrop-filter: blur(20px); border-bottom: 1px solid var(--card-border); padding: 1.5rem 2rem; - position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow);