google-translate-api
google-translate-api copied to clipboard
Which `http-proxy-agent` package do you use?
Привет, I could not find createHttpProxyAgent
in the package. Which lib are you using?
I am using HttpProxyAgent
for now. But the generated agent seems not working with your lib. Your lib is using an old agent somehow.
Hi! I was using http-proxy-agent
5.x where createHttpProxyAgent
was defined. Now updated examples and readme for using 7.x with HttpProxyAgent
class.
Thank you!
Is the proxy working for you? I use the same code. But it seems like the lib is not using the proxy ip, it's using my local ip.
Is the proxy working for you? I use the same code. But it seems like the lib is not using the proxy ip, it's using my local ip.
Yes, works for me. Could you try this?
$ npx ts-node-esm examples/with-proxy.ts 163.53.18.119:80
Using proxy: 163.53.18.119:80
Translating: Ich muss Deutsch lernen!
Result: I have to learn German!
Yep. I tried. Still not working. No one faces this issue besides me? 😓
Interesting. Could you try this snippet to check HttpProxyAgent in isolation?:
import { HttpProxyAgent } from 'http-proxy-agent';
import fetch from 'node-fetch';
main();
async function main() {
console.log('without proxy');
const res1 = await fetch('https://www.httpbin.org/ip');
console.log(await res1.text());
console.log('with proxy');
const agent = new HttpProxyAgent(`http://133.18.234.13:80`); // maybe proxy needs to be replaced with fresher one
const res2 = await fetch('https://www.httpbin.org/ip', { agent });
console.log(await res2.text());
}
My output is:
without proxy
{
"origin": "xx.xxx.83.147"
}
with proxy
{
"origin": "133.18.234.13"
}
also meet this problem.