cjvnjde / google-translate-api-browser

A free and unlimited API for Google Translate
https://www.npmjs.com/package/google-translate-api-browser
MIT License
213 stars 31 forks source link

Proxy Support Please #23

Closed Pevernow closed 1 year ago

Pevernow commented 1 year ago

For some reason, I need to access Google through a proxy server.

Is there any way to translate text through an agent?

cjvnjde commented 1 year ago

For this case, you can use createRequestBody and generateRequestUrl to make requests; you can also use the normaliseResponse function to format responses. These functions allow you to modify requests as desired (including using proxies or something else) and dictate the way you make them, whether it's through axios, fetch, or https.

You can find an example here