forked from cloudflare/node-cloudflare
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
gotOptions
constructor options
This allows the user to pass optional options through to the `got` instance. For instance, users can now connect via proxies. Here is an example using [`caw`](https://github.com/kevva/caw), as further described in [sindresorhus/got#435](sindresorhus/got#435 (comment)) and originally brought up in [sindresorhus/got#79](sindresorhus/got#79). ```js import Cloudflare from 'cloudflare': import caw from 'caw'; const cf = new Cloudflare({ email: '[email protected]', key: '<your API key here>', gotOptions: { agent: caw({ protocol: 'https' }) // Cloudflare API is HTTPS only } }); ```
- Loading branch information
1 parent
c3e1c83
commit 061c9a4
Showing
5 changed files
with
3,309 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,8 @@ the [My Account][my-account] page in the Cloudflare dashboard. | |
```javascript | ||
var cf = require('cloudflare')({ | ||
email: '[email protected]', | ||
key: 'your Cloudflare API key' | ||
key: 'your Cloudflare API key', | ||
gotOptions: {} // options passed to `got`, like a HTTP agent for proxying | ||
}); | ||
``` | ||
|
||
|
@@ -71,4 +72,4 @@ async function getZoneStatus(id) { | |
* `purgeCache(zoneId, params)` | ||
* user | ||
* `read()` | ||
* `edit(params)` | ||
* `edit(params)` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.