This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function hook(req, res, next) { | |
| var _end = res.end; | |
| res.end = function() { | |
| // process something | |
| res.end = _end; | |
| res.end(); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OutgoingMessage.prototype.end = function(data, encoding) { | |
| if (this.finished) { | |
| return false; | |
| } | |
| if (!this._header) { | |
| this._implicitHeader(); | |
| } | |
| if (data && !this._hasBody) { | |
| debug('This type of response MUST NOT have a body. ' + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TypeError: Object #<Object> has no method '_implicitHeader' | |
| at http.js:645:10 | |
| at ServerResponse.end (/Users/syshen/Codes/node/web/connect_server.js:13:9) | |
| at Object.handleResponse [as handle] (/Users/syshen/Codes/node/web/connect_server.js:20:9) | |
| at next (/Users/syshen/Codes/node/web/node_modules/connect/lib/http.js:201:15) | |
| at Object.hook [as handle] (/Users/syshen/Codes/node/web/connect_server.js:15:5) | |
| at next (/Users/syshen/Codes/node/web/node_modules/connect/lib/http.js:201:15) | |
| at Object.query [as handle] (/Users/syshen/Codes/node/web/node_modules/connect/lib/middleware/query.js:38:5) | |
| at next (/Users/syshen/Codes/node/web/node_modules/connect/lib/http.js:201:15) | |
| at Object.cookieParser [as handle] (/Users/syshen/Codes/node/web/node_modules/connect/lib/middleware/cookieParser.js:44:5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function hook(req, res, next) { | |
| var _end = res.end; | |
| res.end = function() { | |
| // process something | |
| _end(); | |
| } | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function test1() { | |
| this.name = "test1"; | |
| this.print = function() { | |
| console.log(this.name); | |
| } | |
| } | |
| function test2() { | |
| this.name = "test2"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function parent() { | |
| this.print = function() {}; | |
| this.hello = function() {}; | |
| } | |
| function child() { | |
| } | |
| parent.call(child.prototype); | |
| var c = new child(); | |
| c.print(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function test1() { | |
| this.name = "test1"; | |
| this.print = function() { | |
| console.log(this.name); | |
| } | |
| } | |
| function test2() { | |
| this.name = "test2"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function MyFunc() { | |
| console.log(this); | |
| } | |
| MyFunc(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function MyClass() { | |
| this.x = 123; | |
| this.y = 456; | |
| }; | |
| MyClass.prototype.show = function() { | |
| console.log(this); | |
| }; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('Strategy in round robin', function() { | |
| describe("with one proxy setting", function() { | |
| basic_options["backends"] = [ | |
| { | |
| host: "127.0.0.1", | |
| port: 8001, | |
| https: false | |
| } | |
| ]; | |
| var proxy = new lbProxy.LoadBalancingProxy(basic_options); |