onlyrickroll commited on
Commit
0fd3e7f
·
verified ·
1 Parent(s): b8026c5

Update test.sh

Browse files
Files changed (1) hide show
  1. test.sh +7 -2
test.sh CHANGED
@@ -7,19 +7,24 @@ TEMP_DIR="/tmp/proxy_test"
7
  mkdir -p $TEMP_DIR && rm -rf $TEMP_DIR/*
8
 
9
  echo "--- 正在获取 SOCKS5 列表 ---"
10
- curl -sL $PROXY_SOURCE | head -n 150 > $TEMP_DIR/list.txt
11
 
12
- echo "--- 并行测试代理 (150个) ---"
13
  test_proxy() {
14
  local ip_port=$1
15
  local id=$2
16
  if curl -s --socks5 "$ip_port" --connect-timeout 4 "$TEST_TARGET" > /dev/null; then
17
  echo "socks5://$ip_port" > "$TEMP_DIR/success_$id"
 
 
18
  fi
19
  }
20
 
21
  count=0
22
  while read -r line; do
 
 
 
23
  test_proxy "$line" "$count" &
24
  count=$((count + 1))
25
  done < $TEMP_DIR/list.txt
 
7
  mkdir -p $TEMP_DIR && rm -rf $TEMP_DIR/*
8
 
9
  echo "--- 正在获取 SOCKS5 列表 ---"
10
+ curl -sL $PROXY_SOURCE | head -n 180 > $TEMP_DIR/list.txt
11
 
12
+ echo "--- 并行测试代理 (180个) ---"
13
  test_proxy() {
14
  local ip_port=$1
15
  local id=$2
16
  if curl -s --socks5 "$ip_port" --connect-timeout 4 "$TEST_TARGET" > /dev/null; then
17
  echo "socks5://$ip_port" > "$TEMP_DIR/success_$id"
18
+ else
19
+ echo "failed"
20
  fi
21
  }
22
 
23
  count=0
24
  while read -r line; do
25
+ PROXY="$line"
26
+
27
+ echo -n "测试 $PROXY ... "
28
  test_proxy "$line" "$count" &
29
  count=$((count + 1))
30
  done < $TEMP_DIR/list.txt