Skip to content

Commit

Permalink
edits on proxies in the Install.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jun 5, 2018
1 parent 075815b commit 92d4d80
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions wiki/Install.md
Expand Up @@ -90,15 +90,8 @@ var_dump (\ccxt\Exchange::$exchanges); // print a list of all available exchange

In some specific cases you may want a proxy, if you experience issues with [DDoS protection by Cloudflare](https://github.com/ccxt/ccxt/wiki/Manual#ddos-protection-by-cloudflare) or your network / country / IP is rejected by their filters.

If you need a proxy, use the `proxy` property (a string literal) containing base URL of http(s) proxy. It is for use with web browsers and from blocked locations.

**Bear in mind that each added intermediary contributes to the overall latency and roundtrip time. Longer delays can result in price slippage.**

The absolute exchange endpoint URL is appended to `proxy` string before HTTP request is sent to exchange. The proxy setting is an empty string `''` by default. Below are examples of a non-empty proxy string (last slash is mandatory!):

- `kraken.proxy = 'https://crossorigin.me/'`
- `gdax.proxy = 'https://cors-anywhere.herokuapp.com/'`

### Python Proxies

The python version of the library uses the [python-requests](python-requests.org) package for underlying HTTP and supports all means of customization available in the `requests` package, including proxies.
Expand Down Expand Up @@ -234,9 +227,16 @@ A more detailed documentation on using proxies with the sync python version of t

## CORS (Access-Control-Allow-Origin)

If you need a CORS proxy, use the `proxy` property (a string literal) containing base URL of http(s) proxy. It is for use with web browsers and from blocked locations.

CORS is [Cross-Origin Resource Sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing). When accessing the HTTP REST API of an exchange from browser with ccxt library you may get a warning or an exception, saying `No 'Access-Control-Allow-Origin' header is present on the requested resource`. That means that the exchange admins haven't enabled access to their API from arbitrary web browser pages.

You can still use the ccxt library from your browser via a CORS-proxy, which is very easy to set up or install. There are also public CORS proxies on the internet, like [https://crossorigin.me](https://crossorigin.me).
You can still use the ccxt library from your browser via a CORS-proxy, which is very easy to set up or install. There are also public CORS proxies on the internet.

The absolute exchange endpoint URL is appended to `proxy` string before HTTP request is sent to exchange. The `proxy` setting is an empty string `''` by default. Below are examples of a non-empty `proxy` string (last slash is mandatory!):

- `kraken.proxy = 'https://crossorigin.me/'`
- `gdax.proxy = 'https://cors-anywhere.herokuapp.com/'`

To run your own CORS proxy locally you can either set up one of the existing ones or make a quick script of your own, like shown below.

Expand Down

0 comments on commit 92d4d80

Please sign in to comment.