y-server-plugin-proxy is a y-server plugin to proxy request.
npm install y-server-plugin-proxy
const path = require('path');
const yServer = require('y-server');
const proxyPlugin = require('y-server-plugin-proxy');
yServer({
plugins: [
proxyPlugin({
proxyPaths: ['/majax/*'],
proxyServer: 'http://m.readnovel.com',
proxyOptions: {
query: {},
headers: {},
},
}),
],
});
-
proxyPaths
is the Array which will be proxy. -
proxyServer
is the proxy server. -
proxyOptions
is the proxy options (see express-request-proxy).