ndt-server icon indicating copy to clipboard operation
ndt-server copied to clipboard

Minimal download test using CURL

Open stephen-soltesz opened this issue 1 year ago • 0 comments

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.

stephen-soltesz avatar Aug 22 '23 14:08 stephen-soltesz