ubdate
This commit is contained in:
37
node_modules/caw/index.js
generated
vendored
Normal file
37
node_modules/caw/index.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
const url = require('url');
|
||||
const getProxy = require('get-proxy');
|
||||
const isurl = require('isurl');
|
||||
const tunnelAgent = require('tunnel-agent');
|
||||
const urlToOptions = require('url-to-options');
|
||||
|
||||
module.exports = (proxy, opts) => {
|
||||
proxy = proxy || getProxy();
|
||||
opts = Object.assign({}, opts);
|
||||
|
||||
if (typeof proxy === 'object') {
|
||||
opts = proxy;
|
||||
proxy = getProxy();
|
||||
}
|
||||
|
||||
if (!proxy) {
|
||||
return null;
|
||||
}
|
||||
|
||||
proxy = isurl.lenient(proxy) ? urlToOptions(proxy) : url.parse(proxy);
|
||||
|
||||
const uriProtocol = opts.protocol === 'https' ? 'https' : 'http';
|
||||
const proxyProtocol = proxy.protocol === 'https:' ? 'Https' : 'Http';
|
||||
const port = proxy.port || (proxyProtocol === 'Https' ? 443 : 80);
|
||||
const method = `${uriProtocol}Over${proxyProtocol}`;
|
||||
|
||||
delete opts.protocol;
|
||||
|
||||
return tunnelAgent[method](Object.assign({
|
||||
proxy: {
|
||||
port,
|
||||
host: proxy.hostname,
|
||||
proxyAuth: proxy.auth
|
||||
}
|
||||
}, opts));
|
||||
};
|
||||
9
node_modules/caw/license
generated
vendored
Normal file
9
node_modules/caw/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
82
node_modules/caw/package.json
generated
vendored
Normal file
82
node_modules/caw/package.json
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"_from": "caw@^2.0.0",
|
||||
"_id": "caw@2.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-Cg8/ZSBEa8ZVY9HspcGUYaK63d/bN7rqS3CYCzEGUxuYv6UlmcjzDUz2fCFFHyTvUW5Pk0I+3hkA3iXlIj6guA==",
|
||||
"_location": "/caw",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "caw@^2.0.0",
|
||||
"name": "caw",
|
||||
"escapedName": "caw",
|
||||
"rawSpec": "^2.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/bin-wrapper/download",
|
||||
"/download"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/caw/-/caw-2.0.1.tgz",
|
||||
"_shasum": "6c3ca071fc194720883c2dc5da9b074bfc7e9e95",
|
||||
"_spec": "caw@^2.0.0",
|
||||
"_where": "/var/www/html/jason/WeihnachtenMelly/node_modules/download",
|
||||
"author": {
|
||||
"name": "Kevin Mårtensson",
|
||||
"email": "kevinmartensson@gmail.com",
|
||||
"url": "github.com/kevva"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/kevva/caw/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"get-proxy": "^2.0.0",
|
||||
"isurl": "^1.0.0-alpha5",
|
||||
"tunnel-agent": "^0.6.0",
|
||||
"url-to-options": "^1.0.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Construct HTTP/HTTPS agents for tunneling proxies",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"create-cert": "^1.0.4",
|
||||
"get-port": "^3.1.0",
|
||||
"got": "^7.0.0",
|
||||
"pify": "^3.0.0",
|
||||
"proxyquire": "^1.7.9",
|
||||
"sinon": "^2.3.1",
|
||||
"universal-url": "1.0.0-alpha",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/kevva/caw#readme",
|
||||
"keywords": [
|
||||
"http",
|
||||
"https",
|
||||
"proxy",
|
||||
"tunnel"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "caw",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kevva/caw.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "2.0.1",
|
||||
"xo": {
|
||||
"rules": {
|
||||
"ava/no-skip-test": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
51
node_modules/caw/readme.md
generated
vendored
Normal file
51
node_modules/caw/readme.md
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
# caw [](https://travis-ci.org/kevva/caw)
|
||||
|
||||
> Construct HTTP/HTTPS agents for tunneling proxies
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install caw
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const caw = require('caw');
|
||||
const got = require('got');
|
||||
|
||||
got('todomvc.com', {
|
||||
agent: caw()
|
||||
}, () => {});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### caw([proxy], [options])
|
||||
|
||||
#### proxy
|
||||
|
||||
Type: `string`
|
||||
|
||||
Proxy URL. If not set, it'll try getting it using [`get-proxy`](https://github.com/kevva/get-proxy).
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
Besides the options below, you can pass in options allowed in [tunnel-agent](https://github.com/request/tunnel-agent).
|
||||
|
||||
##### protocol
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `http`
|
||||
|
||||
Endpoint protocol.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Kevin Mårtensson](https://github.com/kevva)
|
||||
Reference in New Issue
Block a user