# Path: sockjs/cyclone/proto.py
# CONNECT = 'o'
# DISCONNECT = 'c'
# MESSAGE = 'm'
# HEARTBEAT = 'h'
# def disconnect(code, reason):
# 
# Path: sockjs/cyclone/transports/streamingbase.py
# class StreamingTransportBase(pollingbase.PollingTransportBase):
#     def initialize(self, server):
#     def should_finish(self, data_len):
#     def session_closed(self):


from cyclone.web import asynchronous
from sockjs.cyclone import proto
from sockjs.cyclone.transports import streamingbase



# HTMLFILE template
HTMLFILE_HEAD = r'''
<!doctype html>
<html><head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head><body><h2>Don't panic!</h2>
  <script>
    document.domain = document.domain;
    var c = parent.%s;
    c.start();
    function p(d) {c.message(d);};
    window.onload = function() {c.stop();};
  </script>
'''.strip()
HTMLFILE_HEAD += ' ' * (1024 - len(HTMLFILE_HEAD) + 14)
HTMLFILE_HEAD += '\r\n\r\n'



# Path: sockjs/cyclone/proto.py
# CONNECT = 'o'
# DISCONNECT = 'c'
# MESSAGE = 'm'
# HEARTBEAT = 'h'
# def disconnect(code, reason):
# 
# Path: sockjs/cyclone/transports/streamingbase.py
# class StreamingTransportBase(pollingbase.PollingTransportBase):
#     def initialize(self, server):
#     def should_finish(self, data_len):
#     def session_closed(self):


# Path: sockjs/cyclone/transports/htmlfile.py
from cyclone.web import asynchronous
from sockjs.cyclone import proto
from sockjs.cyclone.transports import streamingbase




# HTMLFILE template
HTMLFILE_HEAD = r'''
<!doctype html>
<html><head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head><body><h2>Don't panic!</h2>
  <script>
    document.domain = document.domain;
    var c = parent.%s;
    c.start();
    function p(d) {c.message(d);};
    window.onload = function() {c.stop();};
  </script>
'''.strip()
HTMLFILE_HEAD += ' ' * (1024 - len(HTMLFILE_HEAD) + 14)
HTMLFILE_HEAD += '\r\n\r\n'



class HtmlFileTransport(streamingbase.StreamingTransportBase):