grunt-connect-proxy
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -99,3 +99,3 @@ 'use strict'; | ||
function enableWebsocket(server) { | ||
if (!server.proxyWs) { | ||
if (server && !server.proxyWs) { | ||
server.proxyWs = true; | ||
@@ -102,0 +102,0 @@ utils.log.verbose.writeln('[WS] Catching upgrade event...'); |
{ | ||
"name": "grunt-connect-proxy", | ||
"description": "Provides a http proxy as middleware for grunt connect.", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"homepage": "https://github.com/drewzboto/grunt-connect-proxy", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -62,12 +62,11 @@ # grunt-connect-proxy | ||
middleware: function (connect, options) { | ||
var middlewares = []; | ||
var directory = options.directory || options.base[options.base.length - 1]; | ||
if (!Array.isArray(options.base)) { | ||
options.base = [options.base]; | ||
} | ||
// Setup the proxy | ||
middlewares.push(require('grunt-connect-proxy/lib/utils').proxyRequest); | ||
// Setup the proxy | ||
var middlewares = [require('grunt-connect-proxy/lib/utils').proxyRequest]; | ||
// Serve static files. | ||
options.base.forEach(function(base) { | ||
// Serve static files. | ||
middlewares.push(connect.static(base)); | ||
@@ -77,2 +76,3 @@ }); | ||
// Make directory browse-able. | ||
var directory = options.directory || options.base[options.base.length - 1]; | ||
middlewares.push(connect.directory(directory)); | ||
@@ -279,1 +279,2 @@ | ||
* 0.1.7 Added WebSocket support (thanks for @killfill), Headers support (thanks to @gadr), various docs fixed | ||
* 0.1.8 Minor websocket bug fix |
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
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
278
40290