Http-proxy-middleware: cookieDomainRewrite don't works

Created on 13 Dec 2016  路  3Comments  路  Source: chimurai/http-proxy-middleware

var proxyMiddleware = require('http-proxy-middleware')
var proxyTable = {
      '/web':{
      target: 'http://10086.com:8080', // running on localhost set 'http://localhost:8080'
      changeOrigin: true,
      pathRewrite: {
            '^/web' : '/',     // true request to remote server will remove suffix '/web'
        },
      cookieDomainRewrite:{
        '*':'localhost' // all domain cooke rewrite to localhost
        }
      }
    }

Object.keys(proxyTable).forEach(function (context) {
  var options = proxyTable[context]
  if (typeof options === 'string') {
    options = { target: options }
  }
  app.use(proxyMiddleware(context, options))
})

I can not get any cookie from remote server,'cookieDomainRewrite' useless that can not search in module source code

Most helpful comment

@chimurai
My http-proxy 's version is v1.16.2, but cookieDomainRewrite also don't work, please help me to resolve this problem. Thanks

All 3 comments

http-proxy-middleware uses http-proxy. that's probably why you can't find references in this project.

cookieDomainRewrite is added in http-proxy v1.16.1 (https://github.com/nodejitsu/node-http-proxy/commit/8cb451f20cff0a19fc9576fc2558307fb17a5710)

Check if you are using the right version with npm ls in your project.

@chimurai Thx

@chimurai
My http-proxy 's version is v1.16.2, but cookieDomainRewrite also don't work, please help me to resolve this problem. Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SidneyNemzer picture SidneyNemzer  路  5Comments

mshindal picture mshindal  路  4Comments

lukaszpochrzest picture lukaszpochrzest  路  3Comments

joshiste picture joshiste  路  4Comments

maks-rafalko picture maks-rafalko  路  8Comments