0

Good day,

Please help with an example of how to use idWHOIS via a web proxy? I want to make whois calls anonymously using free web proxies.

Why is it so simple with idHTTP component that have ProxyParams but with idWHOIS not?

I am really clueless :)

See my attempted code snipped:

procedure TForm2.Button2Click(Sender: TObject);
var
  ProxyHTTP :TIdConnectThroughHttpProxy;
  Proxy :TIdCustomTransparentProxy;
begin
  ProxyHTTP := TIdConnectThroughHttpProxy.Create(Self);
  Proxy := TIdCustomTransparentProxy.Create(Self);
  Try

{    idIOHandler.TransparentProxy := Proxy;

    Proxy.Host := 'whois.ausregistry.net.au';
    Proxy.Port := StrToInt('43');
    Proxy.IPVersion := ID_DEFAULT_IP_VERSION;
//    Proxy.Connect(idIOHandler, edtProxy.Text, StrToInt(edtPort.Text), ID_DEFAULT_IP_VERSION);
//    Proxy.Enabled;

    Proxy.ChainedProxy := ProxyHTTP;
 }

    idIOHandler.TransparentProxy := ProxyHTTP;
    ProxyHTTP.Host := edtProxy.Text;
    ProxyHTTP.Port :=  StrToInt(edtPort.Text);
    ProxyHTTP.IPVersion := ID_DEFAULT_IP_VERSION;
    ProxyHTTP.OnStatus := ProxyHTTPOnStatus;
    ProxyHTTP.Enabled;
    ProxyHTTP.Connect(idIOHandler, edtProxy.Text, StrToInt(edtPort.Text), ID_DEFAULT_IP_VERSION);

    Memo1.Clear;
    Memo1.Update;
    Memo1.Lines.Text := idWhois.WhoIs(edtDomain.Text + '.com.au');
  Finally
    idIOHandler.Close;
    idWhois.Disconnect;
    Proxy.Free;
    ProxyHTTP := TIdConnectThroughHttpProxy.Create(Self);
  End;
end;
manlio
  • 18,345
  • 14
  • 76
  • 126
Marius
  • 11
  • 3
  • You'd be hard pressed to get a web proxy to talk the whois protocol. This sounds like abusive behavior, anyway. There's a reason many `whois` servers allow only a limited amount of queries per day. – tripleee Aug 23 '12 at 10:55
  • But most registrars do have HTTP front-ends to whois databases. OTOH that prefer to obfuscate data, like showing picture instead of text, to prevent spam harvesters from using whois databases. – Arioch 'The Aug 23 '12 at 11:47
  • retagged: this question is not Delphi specific. It is about general Internet concepts, such as ports and protocols, and about particular HTTP protocol feature (HTTP Proxy). – Arioch 'The Aug 23 '12 at 11:52
  • `whois` (RFC3912) runs on top of TCP, not on top of HTTP. Hence there is no concept of proxies there, and you should not use an HTTP library to do whois queries. – Patrick Mevzek Jan 03 '18 at 23:12

1 Answers1

0

1st of all - do you use whois or http protocol ?

  • there are native whois services working via their native protocol.
  • and there are WWW front-ends, that let you make whois requests and vew results in WWW browsers like MSIE (Microsoft Internet Explorer).

Obviously you should be able to connect to latter via HTTP-proxy. WWW here is monicker for several related technologies used together: HTTP + SSL/TLS + WebDAV + HTML + CSS + JS, etc. So, HTTP proxy may be considered subset of HTTP which is subset of WWW And not be able to connect to former, for whois is not part of WWW blob.

Same thing for example is with e-mail, which is out of WWW realm as well:

  • there are mail programs, connecting directly by IMAP/POP/SMTP protocols and corresponding ports,
  • and there are WWW front-ends like Yahoo and GMail that allow to view mails via MSIE. WWW access works via HTTP proxy, direct access is not HTTP and does not work.

Exception: some proxies allow pin-holling. That is treated as security hole and bad configuration, but nonetheless it is sometimes possbile via HTTP/SSL support command CONNECT. But usually it is not possible to connect to every ports but only to :80 and :443 ports. And it is extremely rare that whois protocol would be on that ports, only HTTP or HTTPS protocols. Some servers, like many messengers like Jabber, ICQ, GTalk, or like Skype super-nodes, intentionally misuse those ports :80 and :443 to provide their non-HTTP protocols, thus helping those program to cheat on HTTP Proxy and bypass NAT isolation. But i think you'd hardly find many whois servers doing this

Whoever, if you find poorly configured proxy or such specially-configured whois server, you would have chance to use it. Otherwise you would only be ably to use idHTTP over existing WWW-front-ends to whois servers. Most DNS name registrars do provide them, so users could check the data using no special tools but only WWW browsers.

Google for "http proxy ssl connect pinholling" for more details about such use of HTTP proxy. Google for "NAT Traversal" and "Proxy Tunelling" for more general concept. Sometimes VPN techniques are [mis-]used to tunnel outside.

PS. this does not answer "how can i do it" - there is no 100% reliable way - but hopefully answers "Why is it so simple with idHTTP component that have ProxyParams but with idWHOIS not?".

I guess you'd meet the very same obstacles, if to us idSMTP or other e-mail components through HTTP proxy.

PPS. there are more generic kind of proxies - Socks Proxy - that should allow any TCP-class protocol to be forwarded. But they are very rare thing.

Arioch 'The
  • 15,799
  • 35
  • 62
  • To be more specific native WHOIS protocol. – Marius Aug 23 '12 at 13:11
  • I also read someting about HTTP proxies supporting the CONNECT request would be able to serve WHOIS requests as well? Is this true? Any pointers or examples? :) – Marius Aug 23 '12 at 13:27
  • i wrote about CONNECT after "Exception: some proxies allow pin-holling" words. I have nothing to add. Examply is at my work, http proxy allows connect to ports :80 and :443. It denies connections to other ports. It allows me to use Jabber messengers (GTalk and some other). Because their servers do abuse those ports for Jabber protocol. I don't know and can not know how your proxy is configured. Nor if there are whois servers abusing :80 and :443 ports for whois protocol. – Arioch 'The Aug 23 '12 at 14:04