Skip to content

jelder/flashpolicyd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Serves Flash socket policy requests using a quick select() interface.

    --file      File containing answer to policy requests.
    --port      TCP port, default is 843.
    --timeout   Timeout, default is 3.
    --daemonize Daemonize, default is 1.
    --pidfile   Write a PID to this file.
    --debug     Be verbose and don't daemonize.

If no arguments are specified, a ridiculously permissive policy file is served on port 843.

Working on MacOS, Linux and OpenBSD. It currently runs in production on the latter, but I expect it to work anywhere you find a modern Perl.

=== Setup for OpenBSD ===

Add this to your pf.conf:

table <flashpolicy> const { self }
rdr pass proto tcp from any to <flashpolicy> \
    port 843 -> \
    127.0.0.1 port 843

This will redirect any Flash policy request to a daemon on 843. You can start the daemon from rc.local, but I prefer to have an angel process. My root crontab includes a line like this:

*   *   *   *   *   nc localhost 843 < /dev/null | grep -q xml || /usr/local/sbin/flashpolicyd

=== Benchmarking ===

The included benchmark script will punish your server for you. These numbers are my MacBook Pro running 10.5.6.

jake@jeldermbp:~/flashpolicyd$ ./flashpolicyd --port 10843
jake@jeldermbp:~/flashpolicyd$ ./flashpolicy-benchmark --port 10843
Trying 1s .. Done.
1704.000000 rps
Trying 30s ............... Done.
489.333333 rps
Trying 60s ................................. Done.
545.783333 rps
Trying 120s ............................................................. Done.
502.950000 rps
Trying 300s ......................................................................................................................................................... Done.
508.460000 rps
Trying 600s .................................................................................................................................................................................................................................................................................................................................. Done.
535.096667 rps

About

A fast, lightweight server for the Flash socket policy protocol

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages