From 866b58531bc769f718e7f0cd26163509a8599c0b Mon Sep 17 00:00:00 2001 From: chunzhi Date: Fri, 9 Feb 2024 21:21:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20ws-test.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ws-test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ws-test.sh b/ws-test.sh index b476955..b4599ce 100644 --- a/ws-test.sh +++ b/ws-test.sh @@ -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"