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"