Quantcast
Viewing all articles
Browse latest Browse all 46

How can I implement a SOCKS proxy to make requests to the whois protocol?

Having trouble wrapping my head around making requests through the SOCKS proxy to whois.lookup.

I have a socks proxy (smartproxy) and a node server. I've tried tunnel, request, socks-proxy-agent, It seems I'm missing the mark completely.

Example of what I'm trying to accomplish:

const whois = require('whois');const { SocksProxyAgent } = require('socks-proxy-agent');const domain = 'google.com';const proxyAgent = new SocksProxyAgent(`socks5://myproxy`);whois.lookup(domain, { proxy: proxyAgent }, (err, data) => {    if (err) {        console.error(err.message);    } else {        console.log('WHOIS Data:', data);    }});

Viewing all articles
Browse latest Browse all 46

Trending Articles