-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Proxy error #10
Comments
can you show us an example of how you used the proxy settings? |
I was using the proxy setting on the package as described in the readme: import { Bard } from "googlebard";
export default async function orchestra() {
const importDynamic = new Function(
"modulePath",
"return import(modulePath)"
);
const { Bard } = await importDynamic("googlebard");
const choirs = new Bard(`__Secure-1PSID="${process.env.BARD_COOKIE!}"`, {
proxy: {
host: process.env.BARD_PROXY_HOST!,
port: process.env.BARD_PROXY_PORT!,
auth: {
username: process.env.BARD_PROXY_USERNAME!,
password: process.env.BARD_PROXY_PASSWORD!,
},
protocol: "http",
},
});
return choirs as Bard;
} That would throw the default error of the package, asking to check the cookie that was set, but with some digging and logging I could find the actual error:
The proxy is being used with the default configuration, I can see it on the proxy object on the error thrown: AxiosError.log The solution I found was to use: import HttpsProxyAgent from "https-proxy-agent";
let axiosOptions = {
proxy: false,
httpsAgent: new HttpsProxyAgent(`http://user:password@ip:port`),
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0",
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate, br",
Connection: "keep-alive",
"Upgrade-Insecure-Requests": "1",
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "none",
"Sec-Fetch-User": "?1",
TE: "trailers",
},
}; This error is being thrown at the GetRequestParams() function, this might be an Axios error, look here Since I changed it directly on the package's code, I didn't do any additional configuration on my end, only changed that part of the code and used it. |
Thank you, can you confirm that the proxy protocol you used is http? maybe its https and you need to set the protocol to https |
Nope, my proxy is http.
|
Since it's not an error caused by this package itself, and I just wanted to document for further references, I'll close this issue. |
Hello!
I recently encountered an issue while using proxies, specifically with Axios. I'm fairly confident that I've set up my proxy correctly, but I'm unsure if the problem lies with Axios itself or if there's a misconfiguration with my proxy.
The issue arose when using the default settings:
With these settings, I received a 502 error, which stated "The requested URL could not be retrieved". This issue seemed to occur when using a Squid proxy.
To rectify this problem, I implemented the following steps:
Here's an example of the changes I made:
I suspect the issue may be a bug with Axios, possibly related to its handling of proxying HTTP to HTTPS. Alternatively, it might be a configuration issue with the Squid proxy. I thought it would be worth raising this issue to bring it to attention.
The text was updated successfully, but these errors were encountered: