Example #1
0
 def setup_environ(self):
     """
     Setup the environ dictionary and add the
     `'ws4py.socket'` key. Its associated value
     is the real socket underlying socket.
     """
     SimpleHandler.setup_environ(self)
     self.environ['ws4py.socket'] = self.environ['wsgi.input']._sock
Example #2
0
 def setup_environ(self):
     """
     Setup the environ dictionary and add the
     `'ws4py.socket'` key. Its associated value
     is the real socket underlying socket.
     """
     SimpleHandler.setup_environ(self)
     self.environ['ws4py.socket'] = get_connection(self.environ['wsgi.input'])
     self.http_version = self.environ['SERVER_PROTOCOL'].rsplit('/')[-1]
Example #3
0
 def setup_environ(self):
     """
     Setup the environ dictionary and add the
     `'ws4py.socket'` key. Its associated value
     is the real socket underlying socket.
     """
     SimpleHandler.setup_environ(self)
     self.environ['ws4py.socket'] = get_connection(self.environ['wsgi.input'])
     self.http_version = self.environ['SERVER_PROTOCOL'].rsplit('/')[-1]
Example #4
0
 def get(self, path):
     """ get the content of a url as rendered by bottle """
     handler = SimpleHandler(sys.stdin, sys.stdout, sys.stderr, {})
     handler.setup_environ()
     env = handler.environ
     env.update({
         "PATH_INFO": "{0}/{1}".format(self.base_url, path),
         "REQUEST_METHOD": "GET",
     })
     out = b"".join(self.app(env, lambda *args: None))
     return out