Permalink
Browse files

Camp update: v12-09-17.

Features a URL-escape fix.
  • Loading branch information...
1 parent c0831b2 commit c0f5fe9c669b1150d0d2215af552d10cf795802b @espadrine espadrine committed Sep 17, 2012
Showing with 88 additions and 152 deletions.
  1. +4 −4 node_modules/camp/lib/camp.js
  2. +2 −15 node_modules/camp/node_modules/socket.io/node_modules/policyfile/package.json
  3. +2 −15 node_modules/camp/node_modules/socket.io/node_modules/redis/package.json
  4. +2 −10 ...node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/package.json
  5. +2 −9 ...ode_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/package.json
  6. +2 −15 ...les/camp/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/package.json
  7. +6 −0 node_modules/camp/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/History.md
  8. +6 −0 node_modules/camp/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/doc/ws.md
  9. +1 −1 ...p/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/examples/fileapi/server.js
  10. +6 −0 ...odules/camp/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/WebSocket.js
  11. +3 −0 .../camp/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/WebSocketServer.js
  12. +3 −11 ...dules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/commander/package.json
  13. +4 −9 ...modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/package.json
  14. +4 −12 node_modules/camp/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/package.json
  15. +15 −1 .../camp/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/test/WebSocket.test.js
  16. +13 −1 ...ules/camp/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/test/testserver.js
  17. +2 −15 ...amp/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/package.json
  18. +3 −11 node_modules/camp/node_modules/socket.io/node_modules/socket.io-client/package.json
  19. +3 −11 node_modules/camp/node_modules/socket.io/package.json
  20. +5 −12 node_modules/camp/package.json
@@ -50,12 +50,12 @@ function Ask (server, req, res) {
this.server = server;
this.req = req;
this.res = res;
+ this.uri = url.parse(req.url, true);
try {
- this.uri = url.parse(decodeURI(req.url), true);
- } catch (e) { // Using `escape` should not kill the server.
- this.uri = url.parse(unescape(req.url), true);
+ this.path = decodeURI(this.uri.pathname);
+ } catch (e) { // Using `escape` should not kill the server.
+ this.path = unescape(this.uri.pathname);
}
- this.path = this.uri.pathname;
this.query = this.uri.query;
}
@@ -37,23 +37,10 @@
"url": "https://github.com/3rd-Eden/FlashPolicyFileServer.git"
}
],
- "_npmUser": {
- "name": "espadrine",
- "email": "thaddee.tyl@gmail.com"
- },
+ "readme": "## LOL, WUT?\nIt basically allows you to allow or disallow Flash Player sockets from accessing your site.\n\n## Installation\n\n```bash\nnpm install policyfile\n```\n## Usage\n\nThe server is based on the regular and know `net` and `http` server patterns. So it you can just listen\nfor all the events that a `net` based server emits etc. But there is one extra event, the `connect_failed`\nevent. This event is triggered when we are unable to listen on the supplied port number.\n\n### createServer\nCreates a new server instance and accepts 2 optional arguments:\n\n- `options` **Object** Options to configure the server instance\n - `log` **Boolean** Enable logging to STDOUT and STDERR (defaults to true)\n- `origins` **Array** An Array of origins that are allowed by the server (defaults to *:*)\n\n```js\nvar pf = require('policyfile');\npf.createServer();\npf.listen();\n```\n\n#### server.listen\nStart listening on the server and it takes 3 optional arguments\n\n- `port` **Number** On which port number should we listen? (defaults to 843, which is the first port number the FlashPlayer checks)\n- `server` **Server** A http server, if we are unable to accept requests or run the server we can also answer the policy requests inline over the supplied HTTP server.\n- `callback` **Function** A callback function that is called when listening to the server was successful.\n\n```js\nvar pf = require('policyfile');\npf.createServer();\npf.listen(1337, function(){\n console.log(':3 yay')\n});\n```\n\nChanging port numbers can be handy if you do not want to run your server as root and have port 843 forward to a non root port number (aka a number above 1024).\n\n```js\nvar pf = require('policyfile')\n , http = require('http');\n\nserver = http.createServer(function(q,r){r.writeHead(200);r.end('hello world')});\nserver.listen(80);\n\npf.createServer();\npf.listen(1337, server, function(){\n console.log(':3 yay')\n});\n```\n\nSupport for serving inline requests over a existing HTTP connection as the FlashPlayer will first check port 843, but if it's unable to get a response there it will send a policy file request over port 80, which is usually your http server.\n\n#### server.add\nAdds more origins to the policy file you can add as many arguments as you like.\n\n```js\nvar pf = require('policyfile');\npf.createServer(['google.com:80']);\npf.listen();\npf.add('blog.3rd-Eden.com:80', 'blog.3rd-Eden.com:8080'); // now has 3 origins\n```\n\n#### server.add\nAdds more origins to the policy file you can add as many arguments as you like.\n\n```js\nvar pf = require('policyfile');\npf.createServer(['blog.3rd-Eden.com:80', 'blog.3rd-Eden.com:8080']);\npf.listen();\npf.remove('blog.3rd-Eden.com:8080'); // only contains the :80 version now\n```\n\n#### server.close\nShuts down the server\n\n```js\nvar pf = require('policyfile');\npf.createServer();\npf.listen();\npf.close(); // OH NVM.\n```\n\n## API\nhttp://3rd-eden.com/FlashPolicyFileServer/\n\n## Examples\nSee https://github.com/3rd-Eden/FlashPolicyFileServer/tree/master/examples for examples\n\n## Licence\n\nMIT see LICENSE file in the repository",
"_id": "policyfile@0.0.4",
- "dependencies": {},
- "devDependencies": {},
- "optionalDependencies": {},
- "engines": {
- "node": "*"
- },
- "_engineSupported": true,
- "_npmVersion": "1.1.21",
- "_nodeVersion": "v0.8.0",
- "_defaultsLoaded": true,
"dist": {
- "shasum": "f7cdf6022ceaffbb7fc27891c0fbeeca2115c0c4"
+ "shasum": "e88d90d19a1df3e520f07ef8cf3fd9d78f36bacc"
},
"_from": "policyfile@0.0.4"
}
Oops, something went wrong.
@@ -17,18 +17,10 @@
},
"dependencies": {},
"devDependencies": {},
- "_npmUser": {
- "name": "espadrine",
- "email": "thaddee.tyl@gmail.com"
- },
+ "readme": "This is a JavaScript parser.\nhttp://github.com/qfox/ZeParser\n(c) Peter van der Zee\nhttp://qfox.nl\n\n\nBenchmark\nhttp://qfox.github.com/ZeParser/benchmark.html\n\nThe Tokenizer is used by the parser. The parser tells the tokenizer whether the next token may be a regular expression or not. Without the parser, the tokenizer will fail if regular expression literals are used in the input.\n\nUsage:\nZeParser.parse(input);\n\nReturns a \"parse tree\" which is a tree of an array of arrays with tokens (regular objects) as leafs. Meta information embedded as properties (of the arrays and the tokens).\n\nZeParser.createParser(input);\n\nReturns a new ZeParser instance which has already parsed the input. Amongst others, the ZeParser instance will have the properties .tree, .wtree and .btree.\n\n.tree is the parse tree mentioned above.\n.wtree (\"white\" tree) is a regular array with all the tokens encountered (including whitespace, line terminators and comments)\n.btree (\"black\" tree) is just like .wtree but without the whitespace, line terminators and comments. This is what the specification would call the \"token stream\".\n\nI'm aware that the naming convention is a bit awkward. It's a tradeoff between short and descriptive. The streams are used quite often in the analysis.\n\nTokens are regular objects with several properties. Amongst them are .tokposw and .tokposw, they correspond with their own position in the .wtree and .btree.\n\nThe parser has two modes for parsing: simple and extended. Simple mode is mainly for just parsing and returning the streams and a simple parse tree. There's not so much meta information here and this mode is mainly built for speed. The other mode has everything required for Zeon to do its job. This mode is toggled by the instance property .ast, which is true by default :)\n\nNon-factory example:\n\nvar input = \"foo\";\nvar tree = []; // this should probably be refactored away some day\nvar tokenizer = new Tokenizer(input); // dito\nvar parser = new ZeParser(input, tokenizer, tree);\nparser.parse(); // returns tree..., should never throw errors\n",
"_id": "zeparser@0.0.5",
- "optionalDependencies": {},
- "_engineSupported": true,
- "_npmVersion": "1.1.21",
- "_nodeVersion": "v0.8.0",
- "_defaultsLoaded": true,
"dist": {
- "shasum": "848c2f10b979f3c68f18d68988e2578c24029822"
+ "shasum": "aa55ee58a35974f80e9d546bbc23deb77acb127f"
},
"_from": "zeparser@0.0.5"
}
@@ -24,17 +24,10 @@
},
"devDependencies": {},
"optionalDependencies": {},
- "_npmUser": {
- "name": "espadrine",
- "email": "thaddee.tyl@gmail.com"
- },
+ "readme": "# active-x-obfuscator\n\nA module to (safely) obfuscate all occurrences of the string 'ActiveX' inside\nany JavaScript code.\n\n## Why?\n\nSome corporate firewalls /proxies such as Blue Coat block JavaScript files to be\ndownloaded if they contain the word `'ActiveX'`. That of course is very annoying\nfor libraries such as [socket.io][] that need to use `ActiveXObject` for\nsupporting IE8 and older.\n\n## Install\n\n```\nnpm install active-x-obfuscator\n```\n\n## Usage\n\n```js\nvar activeXObfuscator = require('active-x-obfuscator');\nvar code = 'foo(new ActiveXObject());';\n\nvar obfuscated = activeXObfuscator(code);\n// -> foo(new window[(['Active'].concat('Object').join('X'))])\n```\n\n## License\n\nLicensed under the MIT license.\n\n[socket.io]: http://socket.io/\n",
"_id": "active-x-obfuscator@0.0.1",
- "_engineSupported": true,
- "_npmVersion": "1.1.21",
- "_nodeVersion": "v0.8.0",
- "_defaultsLoaded": true,
"dist": {
- "shasum": "e570359f5a624d15ca7ede4213398b6219c6b5f8"
+ "shasum": "f2d74cde4ef6cb6c8c9a51309064dbff1d535400"
},
"_from": "active-x-obfuscator@0.0.1"
}
@@ -1,3 +1,9 @@
+v0.4.21 - July 14th, 2012
+=====================
+* Emit error if server reponds with anything other than status code 101. [einaros]
+* Added 'headers' event to server. [rauchg]
+* path.exists moved to fs.exists. [blakmatrix]
+
v0.4.20 - June 26th, 2012
=====================
* node v0.8.0 compatibility release.
@@ -37,6 +37,12 @@ When the Upgrade was successfully, the `callback` will be called with a `ws.WebS
If the underlying server emits an error, it will be forwarded here.
+### Event: 'headers'
+
+`function (headers) { }`
+
+Emitted with the object of HTTP headers that are going to be written to the `Stream` as part of the handshake.
+
### Event: 'connection'
`function (socket) { }`
@@ -34,7 +34,7 @@ function makePathForFile(filePath, prefix, cb) {
if (error) return cb(error);
if (pieces.length == 0) return cb(null, incrementalPath);
incrementalPath += '/' + pieces.shift();
- path.exists(incrementalPath, function(exists) {
+ fs.exists(incrementalPath, function(exists) {
if (!exists) fs.mkdir(incrementalPath, step);
else process.nextTick(step);
});
@@ -439,6 +439,12 @@ function initAsClient(address, options) {
var req = httpObj.request(requestOptions);
(isNodeV4 ? agent : req).on('error', function(error) {
self.emit('error', error);
+ cleanupWebsocketResources.call(this, error);
+ });
+ (isNodeV4 ? agent : req).once('response', function(res) {
+ var error = new Error('unexpected server response (' + res.statusCode + ')');
+ self.emit('error', error);
+ cleanupWebsocketResources.call(this, error);
});
(isNodeV4 ? agent : req).once('upgrade', function(res, socket, upgradeHead) {
if (self.readyState == WebSocket.CLOSED) {
@@ -196,6 +196,9 @@ function handleHybiUpgrade(req, socket, upgradeHead, cb) {
headers['Sec-WebSocket-Protocol'] = protocol;
}
+ // allows external modification/inspection of handshake headers
+ self.emit('headers', headers);
+
socket.setTimeout(0);
socket.setNoDelay(true);
try {
@@ -15,7 +15,7 @@
},
"repository": {
"type": "git",
- "url": "git://github.com/visionmedia/commander.js.git"
+ "url": "https://github.com/visionmedia/commander.js.git"
},
"dependencies": {},
"devDependencies": {
@@ -28,18 +28,10 @@
"engines": {
"node": ">= 0.4.x"
},
- "_npmUser": {
- "name": "espadrine",
- "email": "thaddee.tyl@gmail.com"
- },
+ "readme": "# Commander.js\n\n The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).\n\n [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js)\n\n## Installation\n\n $ npm install commander\n\n## Option parsing\n\n Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n .version('0.0.1')\n .option('-p, --peppers', 'Add peppers')\n .option('-P, --pineapple', 'Add pineapple')\n .option('-b, --bbq', 'Add bbq sauce')\n .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')\n .parse(process.argv);\n\nconsole.log('you ordered a pizza with:');\nif (program.peppers) console.log(' - peppers');\nif (program.pineapple) console.log(' - pineappe');\nif (program.bbq) console.log(' - bbq');\nconsole.log(' - %s cheese', program.cheese);\n```\n\n Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as \"--template-engine\" are camel-cased, becoming `program.templateEngine` etc.\n\n## Automated --help\n\n The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:\n\n``` \n $ ./examples/pizza --help\n\n Usage: pizza [options]\n\n Options:\n\n -V, --version output the version number\n -p, --peppers Add peppers\n -P, --pineapple Add pineappe\n -b, --bbq Add bbq sauce\n -c, --cheese <type> Add the specified type of cheese [marble]\n -h, --help output usage information\n\n```\n\n## Coercion\n\n```js\nfunction range(val) {\n return val.split('..').map(Number);\n}\n\nfunction list(val) {\n return val.split(',');\n}\n\nprogram\n .version('0.0.1')\n .usage('[options] <file ...>')\n .option('-i, --integer <n>', 'An integer argument', parseInt)\n .option('-f, --float <n>', 'A float argument', parseFloat)\n .option('-r, --range <a>..<b>', 'A range', range)\n .option('-l, --list <items>', 'A list', list)\n .option('-o, --optional [value]', 'An optional value')\n .parse(process.argv);\n\nconsole.log(' int: %j', program.integer);\nconsole.log(' float: %j', program.float);\nconsole.log(' optional: %j', program.optional);\nprogram.range = program.range || [];\nconsole.log(' range: %j..%j', program.range[0], program.range[1]);\nconsole.log(' list: %j', program.list);\nconsole.log(' args: %j', program.args);\n```\n\n## Custom help\n\n You can display arbitrary `-h, --help` information\n by listening for \"--help\". Commander will automatically\n exit once you are done so that the remainder of your program\n does not execute causing undesired behaviours, for example\n in the following executable \"stuff\" will not output when\n `--help` is used.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('../');\n\nfunction list(val) {\n return val.split(',').map(Number);\n}\n\nprogram\n .version('0.0.1')\n .option('-f, --foo', 'enable some foo')\n .option('-b, --bar', 'enable some bar')\n .option('-B, --baz', 'enable some baz');\n\n// must be before .parse() since\n// node's emit() is immediate\n\nprogram.on('--help', function(){\n console.log(' Examples:');\n console.log('');\n console.log(' $ custom-help --help');\n console.log(' $ custom-help -h');\n console.log('');\n});\n\nprogram.parse(process.argv);\n\nconsole.log('stuff');\n```\n\nyielding the following help output:\n\n```\n\nUsage: custom-help [options]\n\nOptions:\n\n -h, --help output usage information\n -V, --version output the version number\n -f, --foo enable some foo\n -b, --bar enable some bar\n -B, --baz enable some baz\n\nExamples:\n\n $ custom-help --help\n $ custom-help -h\n\n```\n\n## .prompt(msg, fn)\n\n Single-line prompt:\n\n```js\nprogram.prompt('name: ', function(name){\n console.log('hi %s', name);\n});\n```\n\n Multi-line prompt:\n\n```js\nprogram.prompt('description:', function(name){\n console.log('hi %s', name);\n});\n```\n\n Coercion:\n\n```js\nprogram.prompt('Age: ', Number, function(age){\n console.log('age: %j', age);\n});\n```\n\n```js\nprogram.prompt('Birthdate: ', Date, function(date){\n console.log('date: %s', date);\n});\n```\n\n## .password(msg[, mask], fn)\n\nPrompt for password without echoing:\n\n```js\nprogram.password('Password: ', function(pass){\n console.log('got \"%s\"', pass);\n process.stdin.destroy();\n});\n```\n\nPrompt for password with mask char \"*\":\n\n```js\nprogram.password('Password: ', '*', function(pass){\n console.log('got \"%s\"', pass);\n process.stdin.destroy();\n});\n```\n\n## .confirm(msg, fn)\n\n Confirm with the given `msg`:\n\n```js\nprogram.confirm('continue? ', function(ok){\n console.log(' got %j', ok);\n});\n```\n\n## .choose(list, fn)\n\n Let the user choose from a `list`:\n\n```js\nvar list = ['tobi', 'loki', 'jane', 'manny', 'luna'];\n\nconsole.log('Choose the coolest pet:');\nprogram.choose(list, function(i){\n console.log('you chose %d \"%s\"', i, list[i]);\n});\n```\n\n## Links\n\n - [API documentation](http://visionmedia.github.com/commander.js/)\n - [ascii tables](https://github.com/LearnBoost/cli-table)\n - [progress bars](https://github.com/visionmedia/node-progress)\n - [more progress bars](https://github.com/substack/node-multimeter)\n - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"_id": "commander@0.6.1",
- "optionalDependencies": {},
- "_engineSupported": true,
- "_npmVersion": "1.1.21",
- "_nodeVersion": "v0.8.0",
- "_defaultsLoaded": true,
"dist": {
- "shasum": "23256d7136c633295062196d996b0fdd21153baf"
+ "shasum": "6931934c52789d8a1443804090b8a951d2156655"
},
"_from": "commander@~0.6.1"
}
@@ -23,15 +23,10 @@
"mocha": "latest",
"expect.js": "latest"
},
- "_npmUser": {
- "name": "espadrine",
- "email": "thaddee.tyl@gmail.com"
- },
+ "readme": "# options.js #\n\nA very light-weight in-code option parsers for node.js.\n",
"_id": "options@0.0.3",
- "optionalDependencies": {},
- "_engineSupported": true,
- "_npmVersion": "1.1.21",
- "_nodeVersion": "v0.8.0",
- "_defaultsLoaded": true,
+ "dist": {
+ "shasum": "7a4481d59fa0154f42d72dcebbd245911a3e7388"
+ },
"_from": "options@latest"
}
Oops, something went wrong.

0 comments on commit c0f5fe9

Please sign in to comment.