Comments (5)
can you show us an example of how you used the proxy settings?
from googlebard.
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:
AxiosError: Request failed with status code 502
With the Squid info below it:
</head><body id=ERR_READ_ERROR>\n' +
'<div id="titles">\n' +
'<h1>ERROR</h1>\n' +
'<h2>The requested URL could not be retrieved</h2>\n' +
'</div>\n' +
'<hr>\n' +
'\n' +
'<div id="content">\n' +
'<p>The following error was encountered while trying to retrieve the URL: <a href="https://bard.google.com/">https://bard.google.com/</a></p>\n' +
'\n' +
'<blockquote id="error">\n' +
'<p><b>Read Error</b></p>\n' +
'</blockquote>\n' +
'\n' +
'<p id="sysmsg">The system returned: <i>[No Error]</i></p>\n' +
'\n' +
'<p>An error condition occurred while reading data from the network. Please retry your request.</p>\n' +
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.
Also, I'm not sure if this would impact someone else since most people would use a public proxy and not a private one, so you can close this issue if you find that it woudn't impact most users.
from googlebard.
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
from googlebard.
Nope, my proxy is http.
When I try using it with https, this gets thrown:
cause: Error: write EPROTO 984C0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:355:
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) {
errno: -4046,
code: 'EPROTO',
syscall: 'write'
}
from googlebard.
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.
Thanks!
from googlebard.
Related Issues (20)
- TypeError: Cannot read properties of undefined (reading '0') HOT 7
- how to change language HOT 1
- The proxy does not work HOT 3
- Cookie Validity HOT 2
- Confirmation of validity
- API gives unexpected/bad responses HOT 2
- Google Bard's Reverse Engineering Ineffectiveness after Update
- Google Bard encountered an error HOT 1
- Request fails without the __Secure-1PSIDTS cookie HOT 8
- Empty response when the query includes a url
- Traceback HOT 1
- Sometimes response country code. HOT 3
- How to get the cookie HOT 2
- Add the ability to send message for Bard
- how to use in commonJS HOT 1
- __Secure-1PSIDTS is also needed HOT 3
- My account number is 0 HOT 2
- Error in Response
- ERR_REQUIRE_ESM HOT 1
- SWML_DESCRIPTION_FROM_YOUR_INTERNET_ADDRESS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googlebard.