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

fix(proxy) - explanations #22348

Merged
merged 4 commits into from May 2, 2024
Merged

fix(proxy) - explanations #22348

merged 4 commits into from May 2, 2024

Conversation

ttodua
Copy link
Member

@ttodua ttodua commented May 1, 2024

last comment fix #20686

Users should be aware that from browser-side JS, they can't use proxies (because proxy modules rely on 'net & http' native nodejs modules and there does not exist browser-side support for JS proxy functionality yet).

@@ -1043,6 +1043,10 @@ export default class Exchange {

setProxyAgents (httpProxy, httpsProxy, socksProxy) {
let chosenAgent = undefined;
// in browser-side, proxy modules are not supported in 'fetch/ws' methods
if (!isNode && (httpProxy || httpsProxy || socksProxy)) {
throw new NotSupported (this.id + ' - proxies in browser-side projects are not supported. You have several choices: [A] Use `exchange.proxyUrl` property to redirect through local/remote cors-proxy snippet (find sample file named "sample-local-proxy-server-with-cors" in https://github.com/ccxt/ccxt/tree/master/examples/ folder, which includes sample for REST requests) [B] override `exchange.fetch` && `exchange.watch` methods to send request through your custom setup local/remote corst proxy server');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

property to redirect through local/remote cors-proxy snippet

this sentence does not make sense, what is snippet here? we should replace it with server or just remove it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, it should have been 'server' not 'snippet'. edited

@carlosmiei carlosmiei merged commit 0afd9c8 into ccxt:master May 2, 2024
1 of 2 checks passed
@carlosmiei carlosmiei deleted the http-proxy-warning branch May 2, 2024 08:49
kroitor pushed a commit that referenced this pull request May 2, 2024
* fix(proxy) - explanation to users

* minor

* minor

* Update Exchange.ts

[ci skip]
DelAnt pushed a commit to DelAnt/ccxt that referenced this pull request May 10, 2024
* fix(proxy) - explanation to users

* minor

* minor

* Update Exchange.ts
DelAnt pushed a commit to DelAnt/ccxt that referenced this pull request May 10, 2024
* fix(proxy) - explanation to users

* minor

* minor

* Update Exchange.ts

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

Successfully merging this pull request may close these issues.

I get errors when I try to use proxy with ccxt
2 participants