
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Flash Socket Policy File Server. A server to respond to Flash Socket Policy requests, both inline and through a dedicated server instance.
It basically allows you to allow or disallow Flash Player sockets from accessing your site.
npm install policyfile
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.
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 :)var pf = require('policyfile');
pf.createServer();
pf.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.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).
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.
Adds more origins to the policy file you can add as many arguments as you like.
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
Adds more origins to the policy file you can add as many arguments as you like.
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
Shuts down the server
var pf = require('policyfile');
pf.createServer();
pf.listen();
pf.close(); // OH NVM.
http://3rd-eden.com/FlashPolicyFileServer/
See https://github.com/3rd-Eden/FlashPolicyFileServer/tree/master/examples for examples
MIT see LICENSE file in the repository
FAQs
Flash Socket Policy File Server. A server to respond to Flash Socket Policy requests, both inline and through a dedicated server instance.
The npm package policyfile receives a total of 22,761 weekly downloads. As such, policyfile popularity was classified as popular.
We found that policyfile demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.