Skip to content

Instantly share code, notes, and snippets.

@darkwise
Forked from rbranson/crossdomain.conf
Last active August 29, 2015 14:05
Show Gist options
  • Save darkwise/3fa0830428cfd31814c6 to your computer and use it in GitHub Desktop.
Save darkwise/3fa0830428cfd31814c6 to your computer and use it in GitHub Desktop.
# Add this to your nginx.conf under http { }
server {
listen 843;
server_name localhost;
location / {
proxy_pass http://127.0.0.1:8843;
proxy_http_version 1.0 ;
}
error_page 400 /;
}
# create crossserver.py and let it runing under a supervisor process manager with the following source:
#!/usr/bin/python
import SocketServer
class MyTCPHandler(SocketServer.BaseRequestHandler):
"""
The RequestHandler class for our server.
It is instantiated once per connection to the server, and must
override the handle() method to implement communication to the
client.
"""
def handle(self):
self.data = '''<?xml version="1.0"?>
<cross-domain-policy><allow-access-from domain="*" to-ports="*"/></cross-domain-policy>'''
self.request.sendall(self.data)
if __name__ == "__main__":
HOST, PORT = "localhost", 8843
server = SocketServer.TCPServer((HOST, PORT), MyTCPHandler)
server.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment