Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use shadowsocks/proxy? #108

Open
shadowsocksquestions opened this issue Dec 13, 2022 · 1 comment
Open

Is it possible to use shadowsocks/proxy? #108

shadowsocksquestions opened this issue Dec 13, 2022 · 1 comment

Comments

@shadowsocksquestions
Copy link

I need to use shadowsocks to connect to Google - I can navigate to Google translate in the browser using the proxy, but I can't get it working in the node program. I have tried both the recommended http-proxy-agent and also tried socks-proxy-agent as well as few others, but can't get nothing to work

In the shadowsocks logs, it seems the proxy isn't even attempting to connect to the Shadowsocks client

const translate = require('@vitalets/google-translate-api');
//const createHttpProxyAgent = require ('http-proxy-agent');
const {SocksProxyAgent} = require('socks-proxy-agent');

const info = {
	hostname: '127.0.0.1',
  port: '12345'

};
const agent = new SocksProxyAgent(info);

// const agent = createHttpProxyAgent('http://127.0.0.1:47283');
console.log(agent)

async function tr(){
    console.log("sending...")
    const res = await translate('Привет, мир!', {
        to: 'en',
        fetchOptions: { agent },
      });
      console.log(res)
}

tr()

Does anyone know how to get this working? I would appreciate anyone who has any tips

Thanks

@vitalets
Copy link
Owner

Does the example from socks-proxy-agent repo work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants