更新 ws-test.sh

This commit is contained in:
chunzhi 2024-02-09 21:21:20 +08:00
parent c5506f55a8
commit 866b58531b

View File

@ -25,6 +25,7 @@ while IFS= read -r IP_ADDRESS; do
# Step 3: 使用 curl 测试 WebSocket 连接
HTTP_RESPONSE=$(curl --include \
--no-buffer \
--max-time 5 \
--resolve speed.cloudflare.com:443:"$IP_ADDRESS" \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
@ -39,6 +40,6 @@ while IFS= read -r IP_ADDRESS; do
echo "$IP_ADDRESS" >> "$IP_USE_FILE"
echo "Success: HTTP 200 OK"
else
echo "Failed: HTTP response was $HTTP_RESPONSE"
echo "Failed: HTTP response was $HTTP_RESPONSE or connection timed out "
fi
done < "$IP_FILE"