Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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")
Expand Down
7 changes: 7 additions & 0 deletions env.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion static/js/csvPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function populateTable(data) {
let dict = {}
selected += '<div class="bubble-wrap">'
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 += `<div class="bubble">${headers[i]} : <img src="https://flagcdn.com/w40/${countryCode}.png" alt="${row[i]} flag" style="vertical-align: middle; height: 16px;"></div><br>`;
Expand Down
1 change: 0 additions & 1 deletion static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ <h1>iPerf3 <span class="gradient-text">Speed Test</span></h1>
<svg class="btn-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"/>
</svg>
Select Public iPerf3 Server
Select iPerf3 Server
</button>
<div id="selectedServer"></div>
</div>
Expand Down