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 += '
![${row[i]} flag](https://flagcdn.com/w40/${countryCode}.png)