ccsking
asked on
HOw to check proxy in delphi
Hello experts,
i need fast method that could check http proxy server status.
somth like this:
function check(proxy : string, port : word) : boolean;
returns true if proxy is working.
Thanks.
i need fast method that could check http proxy server status.
somth like this:
function check(proxy : string, port : word) : boolean;
returns true if proxy is working.
Thanks.
ASKER
it is good method but not fast becouse it needs to download data from webpage.
i think it should be the faster way to check proxy
am i right?
i think it should be the faster way to check proxy
am i right?
ASKER
and another thing: method "get" is not very good if you want to check several proxies at same time
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
NOTE: it requires INDY components to be installed. You can download these excellent components for free from
http://www.indyproject.org/download/Borland.html
[BEGIN CODE]
uses
IdHTTP;
function check(proxy : string; port : word) : boolean;
var
IdHTTP: TIdHTTP;
begin
result :=false;
with TIdHTTP.Create(nil) do
begin
ProxyParams.ProxyServer :=proxy;
ProxyParams.ProxyPort :=Port;
try
Get('http://www.google.com');
result :=true;
except
end;
Free;
end;
end;
[END CODE]
I check for http://www.google.com as this site is online for the most time :-)
Hope to help...
Evarest