grunt-connect-proxy
Advanced tools
Comparing version 0.1.10 to 0.1.11
@@ -52,4 +52,2 @@ /* | ||
https: true, | ||
rejectUnauthorized: true, | ||
changeOrigin: true, | ||
xforward: true, | ||
@@ -59,3 +57,2 @@ rewrite: { | ||
}, | ||
timeout: 5000, | ||
headers: { | ||
@@ -109,3 +106,2 @@ "X-Proxied-Header": "added" | ||
port: 8080, | ||
changeOrigin: true | ||
} | ||
@@ -125,3 +121,2 @@ ] | ||
port: 8080, | ||
changeOrigin: true, | ||
headers: { | ||
@@ -128,0 +123,0 @@ "x-proxied-header": "added" |
@@ -87,3 +87,3 @@ 'use strict'; | ||
} | ||
proxy.server.proxyWebSocketRequest(req, socket, head); | ||
proxy.server.ws(req, socket, head); | ||
@@ -93,3 +93,3 @@ proxied = true; | ||
var source = req.url; | ||
var target = (proxy.server.target.https ? 'wss://' : 'ws://') + proxy.server.target.host + ':' + proxy.server.target.port + req.url; | ||
var target = (proxy.server.options.secure ? 'wss://' : 'ws://') + proxy.server.options.target.host + ':' + proxy.server.options.target.port + req.url; | ||
grunt.log.verbose.writeln('[WS] Proxied request: ' + source + ' -> ' + target + '\n' + JSON.stringify(req.headers, true, 2)); | ||
@@ -130,3 +130,3 @@ } | ||
var source = req.originalUrl; | ||
var target = (proxy.server.target.https ? 'https://' : 'http://') + proxy.server.target.host + ':' + proxy.server.target.port + req.url; | ||
var target = (proxy.server.options.secure ? 'https://' : 'http://') + proxy.server.options.target.host + ':' + proxy.server.options.target.port + req.url; | ||
grunt.log.verbose.writeln('Proxied request: ' + source + ' -> ' + target + '\n' + JSON.stringify(req.headers, true, 2)); | ||
@@ -133,0 +133,0 @@ } |
{ | ||
"name": "grunt-connect-proxy", | ||
"description": "Provides a http proxy as middleware for grunt connect.", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"homepage": "https://github.com/drewzboto/grunt-connect-proxy", | ||
@@ -25,3 +25,3 @@ "author": { | ||
"engines": { | ||
"node": ">= 0.8.0" | ||
"node": ">= 0.10.0" | ||
}, | ||
@@ -32,3 +32,3 @@ "scripts": { | ||
"dependencies": { | ||
"http-proxy": "~0.10.3", | ||
"http-proxy": "~1.1.4", | ||
"lodash": "~0.9.0" | ||
@@ -35,0 +35,0 @@ }, |
@@ -41,3 +41,2 @@ # grunt-connect-proxy | ||
https: false, | ||
changeOrigin: false, | ||
xforward: false, | ||
@@ -161,14 +160,2 @@ headers: { | ||
#### options.changeOrigin | ||
Type: `Boolean` | ||
Default: false | ||
Whether to change the origin on the request to the proxy, or keep the original origin. | ||
#### options.rejectUnauthorized: | ||
Type: `Boolean` | ||
Default: false | ||
Whether to reject self-signed certificates when https: true is set. Defaults to accept self-signed certs since proxy is meant for development environments. | ||
#### options.xforward: | ||
@@ -207,7 +194,2 @@ Type: `Boolean` | ||
#### options.timeout | ||
Type: `Number` | ||
The connection timeout in milliseconds. The default timeout is 2 minutes (120000 ms). | ||
#### options.headers | ||
@@ -245,3 +227,2 @@ Type: `Object` | ||
https: false, | ||
changeOrigin: false | ||
} | ||
@@ -283,1 +264,2 @@ ] | ||
* 0.1.10 Minor bug fix | ||
* 0.1.11 Fix Websocket support on Node 0.10 - Bumped http-proxy dependency to 1.1.4, Removed unsupported http-proxy options (rejectUnauthorized, timeout, changeOrigin) |
@@ -45,5 +45,3 @@ /* | ||
https: false, | ||
changeOrigin: false, | ||
xforward: false, | ||
rejectUnauthorized: false, | ||
rules: [], | ||
@@ -55,9 +53,6 @@ ws: false | ||
utils.registerProxy({ | ||
server: new httpProxy.HttpProxy({ | ||
server: httpProxy.createProxyServer({ | ||
target: proxyOption, | ||
changeOrigin: proxyOption.changeOrigin, | ||
enable : { | ||
xforward: proxyOption.xforward // enables X-Forwarded-For | ||
}, | ||
timeout: proxyOption.timeout | ||
secure: proxyOption.https, | ||
xfwd: proxyOption.xforward | ||
}), | ||
@@ -64,0 +59,0 @@ config: proxyOption |
@@ -32,3 +32,3 @@ 'use strict'; | ||
default_options: function(test) { | ||
test.expect(10); | ||
test.expect(8); | ||
var proxies = utils.proxies(); | ||
@@ -42,4 +42,2 @@ | ||
test.equal(proxies[0].config.https, false, 'should have default http'); | ||
test.equal(proxies[0].config.rejectUnauthorized, false, 'should have reject unauthorized default to false'); | ||
test.equal(proxies[0].config.changeOrigin, false, 'should have default change origin'); | ||
test.equal(proxies[0].config.xforward, false, 'should have default xforward'); | ||
@@ -51,3 +49,3 @@ test.equal(proxies[0].config.ws, false, 'should have default ws to false'); | ||
full_options: function(test) { | ||
test.expect(13); | ||
test.expect(11); | ||
var proxies = utils.proxies(); | ||
@@ -61,4 +59,2 @@ | ||
test.equal(proxies[1].config.https, true, 'should have http set from config'); | ||
test.equal(proxies[1].config.rejectUnauthorized, true, 'should have reject unauthorized set from config'); | ||
test.equal(proxies[1].config.changeOrigin, true, 'should have change origin set from config'); | ||
test.equal(proxies[1].config.xforward, true, 'should have xforward set from config'); | ||
@@ -65,0 +61,0 @@ test.equal(proxies[1].config.ws, true, 'should have ws set from config'); |
@@ -9,3 +9,3 @@ var utils = require("../lib/utils.js"); | ||
proxy_options_test: function(test) { | ||
test.expect(11); | ||
test.expect(10); | ||
var proxies = utils.proxies(); | ||
@@ -21,3 +21,2 @@ | ||
test.equal(proxies[0].config.https, false, 'should have default http'); | ||
test.equal(proxies[0].config.changeOrigin, false, 'should have default change origin'); | ||
test.equal(proxies[0].config.ws, false, 'should have default ws to false'); | ||
@@ -24,0 +23,0 @@ test.equal(proxies[0].config.rules.length, 0, 'rules array should have zero items'); |
@@ -9,3 +9,3 @@ var utils = require("../lib/utils.js"); | ||
proxy_options_test: function(test) { | ||
test.expect(9); | ||
test.expect(8); | ||
var proxies = utils.proxies(); | ||
@@ -19,3 +19,2 @@ | ||
test.equal(proxies[0].config.https, false, 'should have default http'); | ||
test.equal(proxies[0].config.changeOrigin, true, 'should have change origin from task'); | ||
test.equal(proxies[0].config.ws, false, 'should have ws default to false'); | ||
@@ -22,0 +21,0 @@ test.equal(proxies[0].config.rules.length, 0, 'rules array should have zero items'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38978
808
261
4
+ Addedeventemitter3@5.0.1(transitive)
+ Addedhttp-proxy@1.1.6(transitive)
- Removedarray-buffer-byte-length@1.0.1(transitive)
- Removedasync@0.2.10(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removeddeep-equal@2.2.3(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-get-iterator@1.1.3(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedfunctions-have-names@1.2.3(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-bigints@1.0.2(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhttp-proxy@0.10.4(transitive)
- Removedi@0.3.7(transitive)
- Removedinternal-slot@1.0.7(transitive)
- Removedis-arguments@1.1.1(transitive)
- Removedis-array-buffer@3.0.4(transitive)
- Removedis-bigint@1.0.4(transitive)
- Removedis-boolean-object@1.1.2(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-date-object@1.0.5(transitive)
- Removedis-map@2.0.3(transitive)
- Removedis-number-object@1.0.7(transitive)
- Removedis-regex@1.1.4(transitive)
- Removedis-set@2.0.3(transitive)
- Removedis-shared-array-buffer@1.0.3(transitive)
- Removedis-string@1.0.7(transitive)
- Removedis-symbol@1.0.4(transitive)
- Removedis-weakmap@2.0.2(transitive)
- Removedis-weakset@2.0.3(transitive)
- Removedisarray@2.0.5(transitive)
- Removedminimist@0.0.101.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedncp@0.4.2(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedobject-is@1.1.6(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedoptimist@0.6.1(transitive)
- Removedpkginfo@0.3.1(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedregexp.prototype.flags@1.5.3(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedset-function-name@2.0.2(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedstop-iteration-iterator@1.0.0(transitive)
- Removedutile@0.2.1(transitive)
- Removedwhich-boxed-primitive@1.0.2(transitive)
- Removedwhich-collection@1.0.2(transitive)
- Removedwhich-typed-array@1.1.15(transitive)
- Removedwordwrap@0.0.3(transitive)
Updatedhttp-proxy@~1.1.4