pax_global_header 0000666 0000000 0000000 00000000064 11652474045 0014522 g ustar 00root root 0000000 0000000 52 comment=f05b7874d4f82bb7d580f144569a1dd3f4de451d FlashPolicyFileServer-0.0.5/ 0000775 0000000 0000000 00000000000 11652474045 0015730 5 ustar 00root root 0000000 0000000 FlashPolicyFileServer-0.0.5/.gitignore 0000664 0000000 0000000 00000000014 11652474045 0017713 0 ustar 00root root 0000000 0000000 node_modules FlashPolicyFileServer-0.0.5/LICENSE 0000664 0000000 0000000 00000002053 11652474045 0016735 0 ustar 00root root 0000000 0000000 Copyright (c) 2011 Arnout Kazemier,3rd-Eden Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. FlashPolicyFileServer-0.0.5/Makefile 0000664 0000000 0000000 00000000207 11652474045 0017367 0 ustar 00root root 0000000 0000000 doc: dox --title "FlashPolicyFileServer" lib/* > doc/index.html test: expresso -I lib $(TESTFLAGS) tests/*.test.js .PHONY: test doc FlashPolicyFileServer-0.0.5/README.md 0000664 0000000 0000000 00000005740 11652474045 0017215 0 ustar 00root root 0000000 0000000 ## LOL, WUT? It basically allows you to allow or disallow Flash Player sockets from accessing your site. ## Installation ```bash npm install policyfile ``` ## Usage The server is based on the regular and know `net` and `http` server patterns. So it you can just listen for all the events that a `net` based server emits etc. But there is one extra event, the `connect_failed` event. This event is triggered when we are unable to listen on the supplied port number. ### createServer Creates a new server instance and accepts 2 optional arguments: - `options` **Object** Options to configure the server instance - `log` **Boolean** Enable logging to STDOUT and STDERR (defaults to true) - `origins` **Array** An Array of origins that are allowed by the server (defaults to *:*) ```js var pf = require('policyfile'); pf.createServer(); pf.listen(); ``` #### server.listen Start listening on the server and it takes 3 optional arguments - `port` **Number** On which port number should we listen? (defaults to 843, which is the first port number the FlashPlayer checks) - `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. - `callback` **Function** A callback function that is called when listening to the server was successful. ```js var pf = require('policyfile'); pf.createServer(); pf.listen(1337, function(){ console.log(':3 yay') }); ``` Changing 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). ```js var pf = require('policyfile') , http = require('http'); server = http.createServer(function(q,r){r.writeHead(200);r.end('hello world')}); server.listen(80); pf.createServer(); pf.listen(1337, server, function(){ console.log(':3 yay') }); ``` Support 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. #### server.add Adds more origins to the policy file you can add as many arguments as you like. ```js var pf = require('policyfile'); pf.createServer(['google.com:80']); pf.listen(); pf.add('blog.3rd-Eden.com:80', 'blog.3rd-Eden.com:8080'); // now has 3 origins ``` #### server.add Adds more origins to the policy file you can add as many arguments as you like. ```js var pf = require('policyfile'); pf.createServer(['blog.3rd-Eden.com:80', 'blog.3rd-Eden.com:8080']); pf.listen(); pf.remove('blog.3rd-Eden.com:8080'); // only contains the :80 version now ``` #### server.close Shuts down the server ```js var pf = require('policyfile'); pf.createServer(); pf.listen(); pf.close(); // OH NVM. ``` ## API http://3rd-eden.com/FlashPolicyFileServer/ ## Examples See https://github.com/3rd-Eden/FlashPolicyFileServer/tree/master/examples for examples ## Licence MIT see LICENSE file in the repository FlashPolicyFileServer-0.0.5/doc/ 0000775 0000000 0000000 00000000000 11652474045 0016475 5 ustar 00root root 0000000 0000000 FlashPolicyFileServer-0.0.5/doc/index.html 0000664 0000000 0000000 00000057451 11652474045 0020506 0 ustar 00root root 0000000 0000000
FlashPolicyFileServer | |
server | lib/server.js |
Module dependencies and cached references. |
|
The server that does the Policy File severing Options
|
|
Start listening for requests
|
|
Adds a new origin to the Flash Policy File.
|
|
Removes a origin from the Flash Policy File.
|
|
Closes and cleans up the server
|
|
Proxy the event listener requests to the created Net server |
|
Creates a new server instance.
|
|
Provide a hook to the original server, so it can be extended if needed.
|
|
Module version
|
|