Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-connect-proxy

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-connect-proxy - npm Package Compare versions

Comparing version 0.1.10 to 0.1.11

5

Gruntfile.js

@@ -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"

6

lib/utils.js

@@ -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');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc