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/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); 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