Socket
Socket
Sign inDemoInstall

http-proxy-middleware

Package Overview
Dependencies
78
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.18.0 to 0.19.0

3

CHANGELOG.md
# Changelog
## [v0.19.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.19.0)
- feat(http-proxy): bump to v1.17.0 ([#261](https://github.com/chimurai/http-proxy-middleware/pull/261))
## [v0.18.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.18.0)

@@ -4,0 +7,0 @@ - fix(vulnerability): update micromatch to v3.x ([npm:braces:20180219](https://snyk.io/test/npm/http-proxy-middleware?tab=issues&severity=high&severity=medium&severity=low#npm:braces:20180219

2

lib/config-factory.js

@@ -29,3 +29,3 @@ var _ = require('lodash')

config.context = oUrl.pathname || '/'
config.options = _.assign(config.options, {target: target}, opts)
config.options = _.assign(config.options, { target: target }, opts)

@@ -32,0 +32,0 @@ if (oUrl.protocol === 'ws:' || oUrl.protocol === 'wss:') {

{
"name": "http-proxy-middleware",
"version": "0.18.0",
"version": "0.19.0",
"description": "The one-liner node.js proxy middleware for connect, express and browser-sync",

@@ -13,2 +13,3 @@ "main": "index.js",

"lint": "standard --verbose | snazzy --colors",
"lint:fix": "standard --fix",
"test": "npm run lint && mocha --recursive --colors --reporter spec",

@@ -45,8 +46,8 @@ "cover": "npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive",

"devDependencies": {
"@commitlint/cli": "^6.1.3",
"@commitlint/config-conventional": "^6.1.3",
"browser-sync": "^2.23.6",
"@commitlint/cli": "^7.1.1",
"@commitlint/config-conventional": "^7.1.1",
"browser-sync": "^2.24.7",
"chai": "^4.1.2",
"connect": "^3.6.6",
"coveralls": "^3.0.0",
"coveralls": "^3.0.2",
"express": "^4.16.3",

@@ -56,14 +57,14 @@ "husky": "^0.14.3",

"istanbul-coveralls": "^1.0.3",
"mocha": "^5.0.4",
"mocha": "^5.2.0",
"mocha-lcov-reporter": "1.3.0",
"opn": "^5.2.0",
"snazzy": "^7.1.1",
"standard": "^11.0.0",
"ws": "^5.0.0"
"opn": "^5.3.0",
"snazzy": "^8.0.0",
"standard": "^12.0.0",
"ws": "^6.0.0"
},
"dependencies": {
"http-proxy": "^1.16.2",
"http-proxy": "^1.17.0",
"is-glob": "^4.0.0",
"lodash": "^4.17.5",
"micromatch": "^3.1.9"
"lodash": "^4.17.10",
"micromatch": "^3.1.10"
},

@@ -70,0 +71,0 @@ "engines": {

@@ -312,2 +312,3 @@ # http-proxy-middleware

* **option.changeOrigin**: true/false, Default: false - changes the origin of the host header to the target URL
* **option.preserveHeaderKeyCase**: true/false, Default: false - specify whether you want to keep letter case of response header key
* **option.auth** : Basic authentication i.e. 'user:password' to compute an Authorization header.

@@ -329,7 +330,40 @@ * **option.hostRewrite**: rewrites the location hostname on (301/302/307/308) redirects.

```
* **option.cookiePathRewrite**: rewrites path of `set-cookie` headers. Possible values:
* `false` (default): disable cookie rewriting
* String: new path, for example `cookiePathRewrite: "/newPath/"`. To remove the path, use `cookiePathRewrite: ""`. To set path to root use `cookiePathRewrite: "/"`.
* Object: mapping of paths to new paths, use `"*"` to match all paths.
For example, to keep one path unchanged, rewrite one path and remove other paths:
```
cookiePathRewrite: {
"/unchanged.path/": "/unchanged.path/",
"/old.path/": "/new.path/",
"*": ""
}
```
* **option.headers**: object, adds [request headers](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields). (Example: `{host:'www.example.org'}`)
* **option.proxyTimeout**: timeout (in millis) when proxy receives no response from target
* **option.timeout**: timeout (in millis) for incoming requests
* **option.followRedirects**: true/false, Default: false - specify whether you want to follow redirects
* **option.selfHandleResponse** true/false, if set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the `proxyRes` event
* **option.buffer**: stream of data to send as the request body. Maybe you have some middleware that consumes the request stream before proxying it on e.g. If you read the body of a request into a field called 'req.rawbody' you could restream this field in the buffer option:
```
'use strict';
const streamify = require('stream-array');
const HttpProxy = require('http-proxy');
const proxy = new HttpProxy();
module.exports = (req, res, next) => {
proxy.web(req, res, {
target: 'http://localhost:4003/',
buffer: streamify(req.rawBody)
}, next);
};
```
## Shorthand

@@ -445,2 +479,2 @@

Copyright (c) 2015-2017 Steven Chim
Copyright (c) 2015-2018 Steven Chim
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