ndt-server
ndt-server copied to clipboard
Minimal download test using CURL
read MACHINE SERVER_URL <<< $( \
curl --silent https://locate.measurementlab.net/v2/nearest/ndt/ndt7 \
| jq -r '.results[0].machine,.results[0].urls."wss:///ndt/v7/download"' )
# Fix url for curl.
SERVER_URL=${SERVER_URL/wss/https}
echo "NDT Download to $MACHINE"
curl --no-buffer \
--max-time 12 \
--header "Sec-WebSocket-Protocol: net.measurementlab.ndt.v7" \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: ndt-$MACHINE" \
--header "Origin: https://ndt-$MACHINE" \
--header "Sec-WebSocket-Version: 13" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
${SERVER_URL} > /dev/null || : # ignore timeouts.