{"_id":"policyfile","_rev":"116704","name":"policyfile","description":"Flash Socket Policy File Server. A server to respond to Flash Socket Policy requests, both inline and through a dedicated server instance.","dist-tags":{"latest":"0.0.6"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"time":{"modified":"2021-06-03T10:49:41.000Z","created":"2011-05-31T20:50:45.177Z","0.0.6":"2017-04-12T18:01:03.607Z","0.0.5":"2011-10-29T23:22:52.420Z","0.0.4":"2011-07-23T20:36:53.025Z","0.0.3":"2011-06-17T09:57:21.732Z","0.0.2":"2011-06-16T18:47:55.845Z","0.0.1":"2011-05-31T20:50:45.177Z"},"users":{"m42am":true},"author":{"name":"Arnout Kazemier"},"repository":{"type":"git","url":"git+https://github.com/3rd-Eden/FlashPolicyFileServer.git"},"versions":{"0.0.6":{"name":"policyfile","version":"0.0.6","author":{"name":"Arnout Kazemier"},"description":"Flash Socket Policy File Server. A server to respond to Flash Socket Policy requests, both inline and through a dedicated server instance.","keywords":["flash","socket","policy","file","server","Flash Socket Policy File Server","cross domain"],"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"license":{"type":"MIT","url":"https://github.com/3rd-Eden/FlashPolicyFileServer/blob/master/LICENSE"},"repository":{"type":"git","url":"git+https://github.com/3rd-Eden/FlashPolicyFileServer.git"},"gitHead":"a3ad25396a63db58afff8d1c1358e1f30458ec37","bugs":{"url":"https://github.com/3rd-Eden/FlashPolicyFileServer/issues"},"homepage":"https://github.com/3rd-Eden/FlashPolicyFileServer#readme","_id":"policyfile@0.0.6","scripts":{},"_shasum":"8689b44c4f42269ee74cf22892aee5995ecf023d","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"3rdeden","email":"npm@3rd-Eden.com"},"dist":{"shasum":"8689b44c4f42269ee74cf22892aee5995ecf023d","size":12052,"noattachment":false,"key":"/policyfile/-/policyfile-0.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/policyfile/download/policyfile-0.0.6.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/policyfile-0.0.6.tgz_1492020063326_0.23513873969204724"},"directories":{},"publish_time":1492020063607,"_hasShrinkwrap":false,"_cnpm_publish_time":1492020063607},"0.0.5":{"name":"policyfile","version":"0.0.5","author":{"name":"Arnout Kazemier"},"description":"Flash Socket Policy File Server. A server to respond to Flash Socket Policy requests, both inline and through a dedicated server instance.","main":"index","keywords":["flash","socket","policy","file","server","Flash Socket Policy File Server","cross domain"],"directories":{"lib":"./lib"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"license":{"type":"MIT","url":"https://github.com/3rd-Eden/FlashPolicyFileServer/blob/master/LICENSE"},"repository":{"type":"git","url":"git://github.com/3rd-Eden/FlashPolicyFileServer.git"},"_npmUser":{"name":"V1","email":"info@3rd-Eden.com"},"_id":"policyfile@0.0.5","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.5.10","_defaultsLoaded":true,"dist":{"shasum":"67afb4b15c90951663cfe75006df036683fad06f","size":20480,"noattachment":false,"key":"/policyfile/-/policyfile-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/policyfile/download/policyfile-0.0.5.tgz"},"publish_time":1319930572420,"_hasShrinkwrap":false,"_cnpm_publish_time":1319930572420},"0.0.4":{"name":"policyfile","version":"0.0.4","author":{"name":"Arnout Kazemier"},"description":"Flash Socket Policy File Server. A server to respond to Flash Socket Policy requests, both inline and through a dedicated server instance.","main":"index","keywords":["flash","socket","policy","file","server","Flash Socket Policy File Server","cross domain"],"directories":{"lib":"./lib"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"licenses":[{"type":"MIT","url":"https://github.com/3rd-Eden/FlashPolicyFileServer/blob/master/LICENSE"}],"repositories":[{"type":"git","url":"https://github.com/3rd-Eden/FlashPolicyFileServer.git"}],"_id":"policyfile@0.0.4","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.12","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"d6b82ead98ae79ebe228e2daf5903311ec982e4d","size":11900,"noattachment":false,"key":"/policyfile/-/policyfile-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/policyfile/download/policyfile-0.0.4.tgz"},"scripts":{},"publish_time":1311453413025,"_hasShrinkwrap":false,"_cnpm_publish_time":1311453413025},"0.0.3":{"name":"policyfile","version":"0.0.3","author":{"name":"Arnout Kazemier"},"description":"Flash Socket Policy File Server. A server to respond to Flash Socket Policy requests, both inline and through a dedicated server instance.  ","main":"index","keywords":["flash","socket","policy","file","server","Flash Socket Policy File Server","cross domain"],"directories":{"lib":"./lib"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"licenses":[{"type":"MIT","url":"https://github.com/3rd-Eden/FlashPolicyFileServer/blob/master/LICENSE"}],"repositories":[{"type":"git","url":"https://github.com/3rd-Eden/FlashPolicyFileServer.git"}],"_npmJsonOpts":{"file":"/Users/arnout/.npm/policyfile/0.0.3/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"policyfile@0.0.3","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.13","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"d78b39879f585e8ffb964d468127e2386fd68c74","size":11825,"noattachment":false,"key":"/policyfile/-/policyfile-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/policyfile/download/policyfile-0.0.3.tgz"},"scripts":{},"publish_time":1308304641732,"_hasShrinkwrap":false,"_cnpm_publish_time":1308304641732},"0.0.2":{"name":"policyfile","version":"0.0.2","author":{"name":"Arnout Kazemier"},"description":"Flash Socket Policy File Server. A server to respond to Flash Socket Policy requests, both inline and through a dedicated server instance.  ","main":"index","keywords":["flash","socket","policy","file","server","Flash Socket Policy File Server","cross domain"],"directories":{"lib":"./lib"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"licenses":[{"type":"MIT","url":"https://github.com/3rd-Eden/FlashPolicyFileServer/blob/master/LICENSE"}],"repositories":[{"type":"git","url":"https://github.com/3rd-Eden/FlashPolicyFileServer.git"}],"_id":"policyfile@0.0.2","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.12","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"f46c9d1b7591adbdfb900bc4cf2a591dd139450f","size":11653,"noattachment":false,"key":"/policyfile/-/policyfile-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/policyfile/download/policyfile-0.0.2.tgz"},"scripts":{},"publish_time":1308250075845,"_hasShrinkwrap":false,"_cnpm_publish_time":1308250075845},"0.0.1":{"name":"policyfile","version":"0.0.1","author":{"name":"Arnout Kazemier"},"description":"Flash Socket Policy File Server. A server to respond to Flash Socket Policy requests, both inline and through a dedicated server instance.  ","main":"index","keywords":["flash","socket","policy","file","server","Flash Socket Policy File Server","cross domain"],"directories":{"lib":"./lib"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"licenses":[{"type":"MIT","url":"https://github.com/3rd-Eden/FlashPolicyFileServer/blob/master/LICENSE"}],"repositories":[{"type":"git","url":"https://github.com/3rd-Eden/FlashPolicyFileServer.git"}],"_id":"policyfile@0.0.1","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.10","_nodeVersion":"v0.4.7","dist":{"shasum":"ba53eee3977a05a2810daf44783abb81a95824be","size":8415,"noattachment":false,"key":"/policyfile/-/policyfile-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/policyfile/download/policyfile-0.0.1.tgz"},"publish_time":1306875045177,"_hasShrinkwrap":false,"_cnpm_publish_time":1306875045177}},"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').createServer();\n\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').createServer();\n\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').createServer()\n  , http = require('http');\n\nserver = http.createServer(function(q,r){r.writeHead(200);r.end('hello world')});\nserver.listen(80);\n\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').createServer(['google.com:80']);\n\npf.listen();\npf.add('blog.3rd-Eden.com:80', 'blog.3rd-Eden.com:8080'); // now has 3 origins\n```\n\n#### server.remove\nRemoves added origins from the policy file - you can add as many arguments as you like.\n\n```js\nvar pf = require('policyfile').createServer(['blog.3rd-Eden.com:80', 'blog.3rd-Eden.com:8080']);\n\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').createServer();\n\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","_attachments":{},"homepage":"https://github.com/3rd-Eden/FlashPolicyFileServer#readme","bugs":{"url":"https://github.com/3rd-Eden/FlashPolicyFileServer/issues"},"license":{"type":"MIT","url":"https://github.com/3rd-Eden/FlashPolicyFileServer/blob/master/LICENSE"}}