Socket
Socket
Sign inDemoInstall

http-proxy-middleware

Package Overview
Dependencies
41
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.17.1 to 0.17.2-beta

7

lib/index.js

@@ -131,7 +131,8 @@ var _ = require('lodash');

function logError(err, req, res) {
var hostname = (req.hostname || req.host) || (req.headers && req.headers.host); // (node0.10 || node 4/5) || (websocket)
var targetUri = (proxyOptions.target.host || proxyOptions.target) + req.url;
var hostname = (req.headers && req.headers.host) || (req.hostname || req.host); // (websocket) || (node0.10 || node 4/5)
var target = proxyOptions.target.host || proxyOptions.target;
var errReference = 'https://nodejs.org/api/errors.html#errors_common_system_errors'; // link to Node Common Systems Errors page
logger.error('[HPM] PROXY ERROR: %s. %s -> %s', err.code, hostname, targetUri);
logger.error('[HPM] Error occurred while trying to proxy request %s from %s to %s (%s) (%s)', req.url, hostname, target, err.code, errReference);
}
};

@@ -146,5 +146,5 @@ var util = require('util');

* -> normal proxy
* => proxyTable
* => router
* ~> pathRewrite
* ≈> proxyTable + pathRewrite
* ≈> router + pathRewrite
*/

@@ -151,0 +151,0 @@ function getArrow(originalPath, newPath, originalTarget, newTarget) {

{
"name": "http-proxy-middleware",
"version": "0.17.1",
"version": "0.17.2-beta",
"description": "The one-liner node.js proxy middleware for connect, express and browser-sync",
"main": "index.js",
"files": [
"index.js",
"lib"
],
"scripts": {

@@ -7,0 +11,0 @@ "clean": "rm -rf coverage",

@@ -113,3 +113,3 @@ # http-proxy-middleware

},
proxyTable: {
router: {
// when request.headers.host == 'dev.localhost:3000',

@@ -116,0 +116,0 @@ // override target 'http://www.example.org' to 'http://localhost:8000'

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc