China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-31 22:27
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Original] Simple detection of whether a proxy server is available using wget View 5,567 Replies 29
Floor 16 Posted 2006-11-28 05:58 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  Re: NaturalJ0

  Thanks for your suggestion, brother.
  After thinking about it, I found that there is a -S parameter in wget that can count the detailed download information, including the connection speed. The speed is indirectly obtained through the front and back two times. If you want to sort, you must analyze the information obtained from the -S parameter, which will be relatively troublesome. Moreover, in the code at the top of the post, the time for wget to time out to obtain the web page is set to 3 seconds, so the detected speed should be acceptable. If you want a faster proxy connection speed, you can modify the value of the -T parameter.

  Re: ccwan

  Thanks for your encouragement, brother.
Floor 17 Posted 2006-11-28 06:51 ·  中国 山东 菏泽 电信
银牌会员
★★★
Credits 1,246
Posts 488
Joined 2003-11-11 00:00
22-year member
UID 12699
Gender Male
Status Offline
Will it continue to check pages 2, 3...?
Floor 18 Posted 2006-11-28 11:39 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  Re: wang6610

  It can only detect the specified industry web proxy list. If you want to detect the proxy lists of other pages, you can manually add URLs to the batch processing. I will also try to improve it as much as possible.
Floor 19 Posted 2006-11-28 13:10 ·  中国 浙江 台州 天台县 电信
新手上路
Credits 5
Posts 7
Joined 2006-11-25 14:29
19-year member
UID 71705
Gender Female
Status Offline
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
HAT -8 2008-11-20 12:50
Floor 20 Posted 2007-01-08 23:39 ·  中国 广东 广州 海珠区 电信
初级用户
Credits 21
Posts 6
Joined 2006-12-17 00:10
19-year member
UID 73746
Gender Male
Status Offline
Floor 21 Posted 2007-01-25 17:00 ·  中国 广东 深圳 电信
初级用户
Credits 31
Posts 14
Joined 2006-07-12 09:05
20-year member
UID 58428
Status Offline
It's really good, but it's a pity that it can only verify the proxy of that one website. It doesn't work when changing to another one. All the proxies of that website have become invalid. It's best to find a verification that can be updated every day. Or make the code more intelligent, so that it can deal with most proxy sites.
Floor 22 Posted 2007-01-25 17:55 ·  中国 广东 深圳 电信
初级用户
Credits 31
Posts 14
Joined 2006-07-12 09:05
20-year member
UID 58428
Status Offline
Can the expert help extract and verify the proxies from this website? http://proxy.chedan.org/
Floor 23 Posted 2007-01-26 02:01 ·  中国 甘肃 平凉 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Originally posted by lixinwu at 2007-1-25 17:55:
Can the expert help extract and verify the proxy of this website? http://proxy.chedan.org/

I wonder if p-proxy can help you
Floor 24 Posted 2007-01-26 03:03 ·  中国 广东 深圳 电信
初级用户
Credits 31
Posts 14
Joined 2006-07-12 09:05
20-year member
UID 58428
Status Offline
Okay, please let the p-proxy expert come and help!
Floor 25 Posted 2007-01-26 04:23 ·  中国 广东 深圳 电信
初级用户
Credits 31
Posts 14
Joined 2006-07-12 09:05
20-year member
UID 58428
Status Offline
Oh, it turns out it's a program... I used it, but unfortunately it doesn't support the code of this website
Floor 26 Posted 2007-01-26 04:24 ·  中国 广东 深圳 电信
初级用户
Credits 31
Posts 14
Joined 2006-07-12 09:05
20-year member
UID 58428
Status Offline
Modifying based on the owner's code should allow extraction. The owner's code is also much more concise and has a much smaller size...
Floor 27 Posted 2007-12-04 07:16 ·  中国 浙江 杭州 电信
中级用户
★★
Credits 321
Posts 135
Joined 2007-02-04 04:48
19-year member
UID 78578
Gender Male
Status Offline
I'm sorry, I'm replying to an old post.

Mainly I haven't understood the following sentences clearly all the time, and I hope some expert can explain them to me:

1 set set=
2 set set=%%a
3 set "set=!set:&#8205=!"
4 set "set=!set!:%%b"

Main questions:
1, Will there be no problem if the system's keyword is used as the environment variable name?
2, Why is it necessary to set it to empty once before each setting? Can the first sentence be omitted?
3, Looking at the original content of the web page:
<tr><td>202.105.182.20&#8205:80</td><td>HTTP</td><td>328,813,813</td><td>Zhuhai City, Guangdong Province</td></tr>
I don't quite understand the algorithm for intercepting the proxy address.
Floor 28 Posted 2007-12-04 07:59 ·  中国 浙江 杭州 电信
中级用户
★★
Credits 321
Posts 135
Joined 2007-02-04 04:48
19-year member
UID 78578
Gender Male
Status Offline
There is also a question, that is, when the data in the source code becomes the following form, how to take into account the two methods?
<tr><td>211.142.213.11&#8204&#8205:80</td><td>HTTP</td><td>110,7203,7203</td><td>Hunan Province, Changsha City, Mobile</td></tr>
Floor 29 Posted 2007-12-04 08:04 ·  中国 浙江 杭州 电信
中级用户
★★
Credits 321
Posts 135
Joined 2007-02-04 04:48
19-year member
UID 78578
Gender Male
Status Offline
```
REM $Id: get.proxy.bat 80 2007-12-04 08:21:12Z honghunter $
REM Original author: lxmxn
REM From: http://www.cn-dos.net/forum/viewthread.php?tid=25126&fpage=0&highlight=&page=1
REM
IF "%ORG_PATH%"=="" CALL D:\dev\dps4e\check_proxy\env_setting.bat

@ECHO OFF&SETLOCAL ENABLEDELAYEDEXPANSION&title Proxy Detection

IF "%1"=="sub1" GOTO sub1

:main
IF EXIST useproxy.txt DEL /a/q useproxy.txt

FOR /L %%A IN (1,1,10) DO CALL %0 sub1 %%A
START useproxy.txt
GOTO :eof

:sub1
SHIFT /1
ECHO;>>useproxy.txt
ECHO Detected available proxies for http://www.cnproxy.com/proxy%1.html on %date% %time%: >>useproxy.txt
ECHO;>>useproxy.txt
ECHO ############################################################# >>useproxy.txt
IF EXIST proxy%1.html DEL proxy%1.html /a/s >nul
wget http://www.cnproxy.com/proxy%1.html >nul 2>nul
:html_down_ok
title Checking proxy%1, please wait....
FOR /f "tokens=1,2 delims=^<trd>: " %%a IN ('type proxy%1.html ^| findstr /c:"HTTP" ') DO (
set set=
set set=%%a
SET "tempset=!set:&#8204&#8205=!"
IF "!tempset!"=="!set!" SET "tempset=!set:&#8205=!"
set "set=!tempset!:%%b"
ECHO Checking proxy !set!, please wait....
wget -q -T 3 -t 1 -e "http_proxy=!set!" http://www.dps4e.com -O - >nul 2>nul && echo Detected ******* !set! ******* proxy available&&echo ----!set! >>useproxy.txt
)
IF EXIST proxy%1.html DEL proxy%1.html /a/s >nul
GOTO :eof


[ Last edited by honghunter on 2007-12-4 at 04:40 PM ]
```
Floor 30 Posted 2008-11-20 12:20 ·  中国 广东 深圳 南山区 电信
新手上路
Credits 4
Posts 4
Joined 2008-11-13 10:39
17-year member
UID 130823
Gender Male
Status Offline
Just tried it and it didn't work? Why are there all ###### signs?
?

[ Last edited by jethroso on 2008-11-20 at 12:24 ]
Forum Jump: