gulp-server-livereload icon indicating copy to clipboard operation
gulp-server-livereload copied to clipboard

How to connect middleware using proxy ? The way is described in document is not working.

Open lawlessnut opened this issue 8 years ago • 5 comments

I'm excepting to forward api request to given target.

   server({
      livereload: {
                enable: true,
                port: 35730,
                defaultFile:"index.html",
                filter: function (filePath, cb) {
                    log(chalk.blue.bgGreen.bold(filePath));
                    cb(!(/node_modules/.test(filePath)));

                }
            },
            open: true,
            port: 9090,
            proxies : [{source: '/nflGame', target:'http://10.21.36.15:8080/nflGame',options: {headers: {'ABC_HEADER': 'abc'}}}]
})

lawlessnut avatar Jan 04 '17 18:01 lawlessnut

+1, I'm having exactly the same issue. Any ideas what's causing this?

AntonRand avatar Jan 20 '17 13:01 AntonRand

My bad, wasn't passing it as an Array!

AntonRand avatar Jan 20 '17 13:01 AntonRand

@AntonRand could you share an example?

egor-miasnikov avatar Jan 27 '17 23:01 egor-miasnikov

@j0gurt Check out the example at the top!

hiddentao avatar Jan 29 '17 13:01 hiddentao

for my requirement i have use browserSync to solve problem. That support multiple proxy forward. https://www.browsersync.io/docs/options

lawlessnut avatar Jan 29 '17 21:01 lawlessnut