kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
docs: update readme for proxy support
rodzic
31a8206fed
commit
b936a04bce
17
readme.md
17
readme.md
|
@ -47,6 +47,7 @@ Thanks && cheers,
|
||||||
- [Demos](#demos)
|
- [Demos](#demos)
|
||||||
- [Authentication](#authentication)
|
- [Authentication](#authentication)
|
||||||
- [CAPTCHAs](#captchas)
|
- [CAPTCHAs](#captchas)
|
||||||
|
- [Using Proxies](#using-proxies)
|
||||||
- [Restrictions](#restrictions)
|
- [Restrictions](#restrictions)
|
||||||
- [Projects](#projects)
|
- [Projects](#projects)
|
||||||
- [Compatibility](#compatibility)
|
- [Compatibility](#compatibility)
|
||||||
|
@ -264,6 +265,22 @@ const api = new ChatGPTAPIBrowser({
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Using Proxies
|
||||||
|
|
||||||
|
The browser implementation supports setting a proxy server. This is useful if you're running into rate limiting issues or if you want to use a proxy to hide your IP address.
|
||||||
|
|
||||||
|
To use a proxy, pass the `proxyServer` option to the `ChatGPTAPIBrowser` constructor, or simply set the `PROXY_SERVER` env var. For more information on the format, see [here](https://www.chromium.org/developers/design-documents/network-settings).
|
||||||
|
|
||||||
|
```ts
|
||||||
|
const api = new ChatGPTAPIBrowser({
|
||||||
|
email: process.env.OPENAI_EMAIL,
|
||||||
|
password: process.env.OPENAI_PASSWORD,
|
||||||
|
proxyServer: '<ip>:<port>'
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also set the `PROXY_VALIDATE_IP` env var to your proxy's IP address. This will be used to validate that the proxy is working correctly, and will throw an error if it's not.
|
||||||
|
|
||||||
### Restrictions
|
### Restrictions
|
||||||
|
|
||||||
These restrictions are for the `getOpenAIAuth` + `ChatGPTAPI` solution, which uses the unofficial API. The browser-based solution, `ChatGPTAPIBrowser`, generally doesn't have any of these restrictions.
|
These restrictions are for the `getOpenAIAuth` + `ChatGPTAPI` solution, which uses the unofficial API. The browser-based solution, `ChatGPTAPIBrowser`, generally doesn't have any of these restrictions.
|
||||||
|
|
Ładowanie…
Reference in New Issue