@ladjs/proxy
Advanced tools
Comparing version 2.0.0 to 2.0.1
11
index.js
@@ -8,3 +8,7 @@ const http = require('http'); | ||
const parse = require('url-parse'); | ||
const proxyWrap = require('findhit-proxywrap'); | ||
const { boolean } = require('boolean'); | ||
const proxiedHttp = proxyWrap.proxy(http); | ||
class ProxyServer { | ||
@@ -19,2 +23,3 @@ constructor(config) { | ||
}, | ||
proxyProtocol: boolean(process.env.PROXY_PROTOCOL || false), | ||
removeWwwPrefix: true, | ||
@@ -57,3 +62,7 @@ // useful option if you don't need https redirect | ||
this.server = http.createServer((req, res) => { | ||
const createServer = this.config.proxyProtocol | ||
? proxiedHttp.createServer | ||
: http.createServer; | ||
this.server = createServer((req, res) => { | ||
router(req, res, finalhandler(req, res)); | ||
@@ -60,0 +69,0 @@ }); |
{ | ||
"name": "@ladjs/proxy", | ||
"description": "Proxy for Lad", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)", | ||
@@ -23,21 +23,23 @@ "ava": { | ||
"dependencies": { | ||
"boolean": "^3.0.1", | ||
"finalhandler": "^1.1.2", | ||
"findhit-proxywrap": "^0.3.12", | ||
"lodash": "^4.17.15", | ||
"router": "^1.3.3", | ||
"router": "^1.3.5", | ||
"url-parse": "^1.4.7" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^8.2.0", | ||
"@commitlint/config-conventional": "^8.2.0", | ||
"ava": "^2.4.0", | ||
"codecov": "^3.6.1", | ||
"cross-env": "^6.0.3", | ||
"@commitlint/cli": "^9.0.1", | ||
"@commitlint/config-conventional": "^9.0.1", | ||
"ava": "^3.10.0", | ||
"codecov": "^3.7.0", | ||
"cross-env": "^7.0.2", | ||
"eslint": "^6.7.2", | ||
"eslint-config-xo-lass": "^1.0.3", | ||
"fixpack": "^2.3.1", | ||
"husky": "^3.1.0", | ||
"lint-staged": "^9.5.0", | ||
"nyc": "^14.1.1", | ||
"remark-cli": "^7.0.1", | ||
"remark-preset-github": "^0.0.16", | ||
"fixpack": "^3.0.6", | ||
"husky": "^4.2.5", | ||
"lint-staged": "^10.2.11", | ||
"nyc": "^15.1.0", | ||
"remark-cli": "^8.0.0", | ||
"remark-preset-github": "^2.0.2", | ||
"supertest": "^4.0.2", | ||
@@ -44,0 +46,0 @@ "xo": "^0.25.3" |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
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
8815
108
1
6
4
+ Addedboolean@^3.0.1
+ Addedfindhit-proxywrap@^0.3.12
+ Addedboolean@3.2.0(transitive)
+ Addedfindhit-proxywrap@0.3.13(transitive)
Updatedrouter@^1.3.5