Proxy for command line utilities in Win XP

2019-04-13 06:39发布

问题:

How do I get command line utilities like ping to use the default proxy in Windows XP.

proxycfg -u sets the proxy to the default (IE) proxy alright, but it doesn't seem to be working.

Update: I am behind a proxy and would like a way to check if a site is up or not hence trying to use ping! Also would like a way to telnet (without using Putty) to a specific site and port to check connectivity.

回答1:

A proxy is usually used for web (HTTP) traffic, ping uses ICMP, which is a completely separate protocol. What, exactly are you trying to do?



回答2:

So, standard ping doesn't go via an HTTP proxy, as everyone's already mentioned. What you probably want is to tunnel your TCP connections (e.g., HTTP, telnet, ssh) via your HTTP proxy using the CONNECT method. For instance, using netcat (telnet will also work, but netcat's better) you'll do the following:

$ nc yourproxy 3128
CONNECT yourtelnetserver:23 HTTP/1.0

then press enter twice.

There are also tools that can do this for you. Keep in mind that some HTTP proxies are configured to allow CONNECT connections only to certain destinations, for example, to port 443 ony (for TLS/SSL/HTTPS).



回答3:

Ping doesn't use TCP - it uses ICMP, so using a proxy doesn't really make sense.

Do you have another command line utility in mind?



回答4:

Your best bet will probably be a command line browser for Windows.

You can try out lynx, which is nearly a full browser, or you can go something simpler and use wget. I would recommend wget myself.

Both programs have some way of configuring a proxy, and the documentation should be the same for both Linux and Windows versions.