1 Introduction
2 How to use it
3 Examples
4 History
5 Legal
Version: 1:0

Flash Cross Domain Policy Server: Library and application for starting a cross domain policy server for Flash.

Edward Blake

 (require (planet edwardlblake/rkt-flash-domain-policy:1:0))

1 Introduction

This is a simple implementation of a Flash cross-domain policy server written in Racket. It can also be invoked from the command line.

Policy servers are used by Flash to determine which ports can be connected to by a Flash-based client application.

2 How to use it

(run-flash-domain-policy-server aaf ...)
Where each aaf is a list of either 2 or 3 elements:
(list  from-domain to-ports)
(list  from-domain to-ports secure)
Optional keyword arguments:
#:notify-proc proc
Where proc is procedure with two arguments:
(lambda (a b)
  (printf "~s ~s" a b))
#:site-control ctrl
Where ctrl is one of:
#:http-reqs (list httpreqs ...)
Where each httpreqs is a list of either 2 or 3 elements:
(list  from-domain headers)
(list  from-domain headers secure)
#:identities (list certs ...)
Where each certs is a list of 2 elements:
(list  signature signature-algorithm)
Parameters for tcp-listen:
#:max-allow-wait number
#:hostname string
#:port port-number

3 Examples

Runs a server that allow access from any domain (*) to port 2000, with the "master-only" site control:
  #:site-control 'master-only
  #:notify-proc (lambda (a b) (printf "~s ~s" a b))
  '("*" 2000))
Runs a server that allow access from *.example.com to three different ports:
(run-flash-domain-policy-server '("*.example.com" (123 234 345)))
Runs a server with everything:
 #:notify-proc (lambda (a b)
                 (printf "~a~n" b))
 #:site-control 'master-only
 #:http-reqs (list '("*" "Jack" #t))
 #:identities (list '("ABC" "DEF"))
 '("*" 2000 #t)
 '("*.example.com" (123 455 200) #t))

4 History

5 Legal

Copyright (c) 2012 Edward L. Blake 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.