Created
June 5, 2011 14:44
-
-
Save fabware/1009008 to your computer and use it in GitHub Desktop.
make socket.io resource take a extra argument
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
| *** listener.js.bak 2011-06-05 21:17:31.777158283 +0800 | |
| --- listener.js 2011-06-05 22:39:51.097153447 +0800 | |
| *************** | |
| *** 69,74 **** | |
| --- 69,82 ---- | |
| var path = url.parse(req.url).pathname, parts, cn; | |
| if (path && path.indexOf('/' + this.options.resource) === 0){ | |
| parts = path.substr(2 + this.options.resource.length).split('/'); | |
| + | |
| + // remove extra from check | |
| + if (parts.length == 4 || parts[parts.length-1] == 'flashsocket'){ | |
| + parts = parts.slice(1, parts.length); | |
| + }; | |
| + | |
| if (this._serveClient(parts.join('/'), req, res)) return true; | |
| if (!(parts[0] in transports)) return false; | |
| if (parts[1]){ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment