CheshireCaat/puppeteer-with-fingerprints

Failed to get proxy IP

Closed this issue · 2 comments

I wish to take advantage of the ability to use custom ip server and so I tested with 2 different socks5h proxy servers today.

Both proxies return same Error: Failed to get proxy ip

Here is my code below. If I change the proxy to use 'http://' instead of socks5:// the proxy2 I am testing works good.

The proxy1 that I am testing does not work with http or socks5 is fails with Error: Failed to get proxy ip.

It appears socks5 does not work correctly based on this test below.

Thank you very much for this amazing software.
`
const { plugin } = require('puppeteer-with-fingerprints');

// The default proxy value is just an example, it won't work.
const proxy1 = 'socks5://user:password@gate.proxy1.com:7000';
const proxy2 = 'socks5://user:password@anotherproxy2.com:12321';

(async () => {
plugin.useProxy(proxy2, {'ipInfoMethod': 'ip-api.com'});

const browser = await plugin.launch({
headless: false,
});

const page = await browser.newPage();
await page.goto('https://bablosoft.com/', { waitUntil: 'domcontentloaded' });

const result = await page.evaluate(() => document.body.innerText.trim());
console.log(result);

await browser.close();
})();`

@Firegarden greetings! You should use ipExtraction options instead of ipInfo.

The last one used for retrieving general info about IP - for example, location and so on.
In turn, the first one are just responsible for getting your output IP - just where you have an error:

plugin.useProxy(proxy2,  {
  ipExtractionURL: 'https://api.ipify.org/',
  ipExtractionMethod: 'raw',
  ipExtractionParam: '',
});

You can use any other service to get the address, I'm just using this one as an example.

Also you can found examples here.

@CheshireCaat this is AMAZING. Thank you thank you thank you. Yes I have tested and socks5 and http both work great with this.