[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [flashproxy/rtmfp] Serve /crossdomain.xml.
commit 8eb56ea0f43e48fecf8a564005c8446ca3477448
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date: Fri May 20 05:17:00 2011 -0700
Serve /crossdomain.xml.
---
facilitator.py | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/facilitator.py b/facilitator.py
index 56a9774..5c33ea2 100755
--- a/facilitator.py
+++ b/facilitator.py
@@ -11,6 +11,7 @@ import sys
import threading
import time
import urllib
+import urlparse
DEFAULT_ADDRESS = "0.0.0.0"
DEFAULT_PORT = 9002
@@ -191,6 +192,12 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
log(u"proxy %s connects" % format_addr(self.client_address))
+ path = urlparse.urlsplit(self.path)[2]
+
+ if path == u"/crossdomain.xml":
+ self.send_crossdomain()
+ return
+
reg = REGS.fetch()
if reg:
log(u"proxy %s gets %s (now %d)" % (format_addr(self.client_address), unicode(reg), len(REGS)))
@@ -231,6 +238,19 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
self.send_response(200)
self.end_headers()
+ def send_crossdomain(self):
+ crossdomain = """\
+<cross-domain-policy>
+<allow-access-from domain="*"/>
+</cross-domain-policy>
+"""
+ self.send_response(200)
+ # Content-Type must be one of a few whitelisted types.
+ # http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security.html#_Content-Type_Whitelist
+ self.send_header("Content-Type", "application/xml")
+ self.end_headers()
+ self.wfile.write(crossdomain)
+
def send_error(self, code, message = None):
self.send_response(code)
self.end_headers()
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits