0.0.98 • Published 9 years ago
gulp-connect-reproxy v0.0.98
gulp-connect-reproxy
A simple proxy middleware for gulp-connect, it can start reverse proxy server with gulp-connect, and it supports Regular Expression.
Install
npm install gulp-connect-reproxy --saveUsage
var gulp = require("gulp");
var connect = require("gulp-connect");
var Reproxy = require("gulp-connect-reproxy");
gulp.task('connect', function () {
connect.server({
root: "build",
port: 9000,
livereload: true,
middleware: function (connect, options) {
options.rule = [/\.do/, /\.jsp/, /\.htm/];
//or options.rule = /\.do/;
options.server = "127.0.0.1:8081";
var proxy = new Reproxy(options);
return [proxy];
}
});
});Notes
@ options.rule
The rule to proxy, it is an array or a string of Regular Expression
@ options.server
a server host name to proxy, contains the host and portExample
If we config it like this
@options : {
rule : /\.do/,
server : "127.0.0.1:8081"
}when we request "http://127.0.0.1:9000/user/edit.do", the proxy server will work and the URL will be redirected to "http://127.0.0.1:8001/user/edit.do"; but when we requrest "http://127.0.0.1:9000/user/user.js", it will not work.
User
Name : Bin Zhang From : Beijing China
0.0.98
9 years ago
0.0.97
9 years ago
0.0.96
9 years ago
0.0.95
9 years ago
0.0.93
10 years ago
0.0.92
10 years ago
0.0.91
10 years ago
0.0.9
10 years ago
0.0.83
10 years ago
0.0.82
10 years ago
0.0.81
10 years ago
0.0.8
10 years ago
0.0.7
10 years ago
0.0.6
10 years ago
0.0.5
10 years ago
0.0.4
10 years ago
0.0.3
10 years ago
0.0.2
10 years ago
0.0.1
10 years ago