Giter Club home page Giter Club logo

efps's Introduction

Erlang/OTP Flash Policy Server (EFPS)

A simple server that listens for connections on port 843 and
serves up a flash policy file when the request '<policy-file-request/>' is
passed in to the connection.

Note : This is a TCP socket server, and *not* an HTTP server. This server must listen on port 843
which is a privileged port on *nix systems.  This server must be started with root privs (sudo)
on such systems or you will see errors on startup.


Configuration
-----------------
Modify the application.cfg file to set the 'allow-access-from domain'
and 'to-ports' config variables that render in the Socket policy XML file.

If unset, by default both are set to the wildcard "*"

Run & Install w/ Rakefile
-----------------

rake -T  # Shows all available rake commands
rake compile
rake start


Manual Dev Installation:
-----------------

cd efps
./rebar compile

# Must start erl with sudo as it runs on the priv *nix port 843
sudo erl -pa ./ebin
application:start(efps).


Manual Full Installation:
-----------------

cd efps
./rebar compile
[sudo] ./rebar install
[sudo] ./rebar install --force     ## as needed

# Must start erl with sudo as it runs on the priv *nix port 843
sudo erl
application:start(efps).


Testing:
--------

echo -n "<policy-file-request/>" | nc localhost 843

Should return:

<cross-domain-policy><allow-access-from domain="*" to-ports="*" /></cross-domain-policy>

There is also a Rakefile task 'rake ping' which will perform the same test.


Performance Testing
---------

There is a crude performance testing tool called 'slam'. When run it will simply open
a large number of simultaneous connections to the efps server.

To run, start the server in one terminal with 'rake start' and in another
terminal run 'rake shell'.  Once in that shell run 'slam:start/1' passing in the number
of connections to make:

(efpshell@macbook-pro)19> slam:start(1000).
ok

This will return 'ok' as well as any errors encountered.


Credits:
--------

http://github.com/kaos/gen_listener_tcp
http://20bits.com/articles/erlang-a-generalized-tcp-server/
http://dizzyd.com/blog/post/194
http://www.simoncobb.co.uk/2008/10/flash-socket-policy-file-in-erlang.html

# settup up a boot file
http://spawnlink.com/articles/an-introduction-to-releases-with-erlybank/


efps's People

Contributors

grempe avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.