gulp-connect-proxy-with-headers

10.4.1 • Public • Published

gulp-connect-proxy-with-headers

A simple proxy middleware for gulp-connect

support post request

pass cookie and other headers

How to use

gulp.task('connect', function () {
  connect.server({
    root: [conf.dist],
    port: 9000,
    livereload: true,
    middleware: function (connect, opt) {
      var Proxy = require('gulp-connect-proxy');
      opt.route = '/proxy';
      var proxy = new Proxy(opt);
      return [proxy];
    }
  });
});

Notes:

opt.route is optional, if omitted requests made to http://localhost:9000/foo.com/bar.png will be proxied.

If opt.route is set requests made to http://localhost:9000/proxy/foo.com/bar.png will be proxied.

This is for development purposes only. If you need a proxy in production use Nginx or Apache.

TODO:

  • Write Tests

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 10.4.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 10.4.1
    2
  • 10.3.1
    0

Package Sidebar

Install

npm i gulp-connect-proxy-with-headers

Weekly Downloads

2

Version

10.4.1

License

ISC

Last publish

Collaborators

  • bborn