Skip to content

Commit

Permalink
Add api for proxyReqWs
Browse files Browse the repository at this point in the history
  • Loading branch information
justgook authored Aug 30, 2016
1 parent 4fa6d74 commit 277c17c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/server/proxy-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ var ProxyOption = Immutable.Record({
* with args [proxyRes, req, res]
*/
proxyRes: List([]),
/**
* Functions to be called on proxy response
* with args [proxyReq, req, socket, options, head]
*/
proxyReqWs: List([]),
errHandler: undefined,
url: Map({}),
proxyOptions: Map(defaultHttpProxyOptions),
Expand Down Expand Up @@ -99,10 +104,11 @@ module.exports = function createProxyServer (bs, scripts) {
}

/**
* Add any user provided functions for proxyReq and proxyRes
* Add any user provided functions for proxyReq, proxyReqWs and proxyRes
*/
applyFns("proxyReq", proxyReq);
applyFns("proxyRes", proxyRes);
applyFns('proxyReqWs', opt.get("proxyReqWs"))

/**
* Handle Proxy errors
Expand Down

0 comments on commit 277c17c

Please sign in to comment.