Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

low priority: wsgiref example doesn't work #145

Closed
Seanny123 opened this issue Sep 15, 2014 · 1 comment
Closed

low priority: wsgiref example doesn't work #145

Seanny123 opened this issue Sep 15, 2014 · 1 comment

Comments

@Seanny123
Copy link
Contributor

From the documentation I extracted this example:

from wsgiref.simple_server import make_server
from ws4py.websocket import EchoWebSocket
from ws4py.server.wsgirefserver import WSGIServer, WebSocketWSGIRequestHandler
from ws4py.server.wsgiutils import WebSocketWSGIApplication

server = make_server('', 9000, server_class=WSGIServer,
                     handler_class=WebSocketWSGIRequestHandler,
                     app=WebSocketWSGIApplication(handler_cls=EchoWebSocket))
server.initialize_websockets_manager()
server.serve_forever()

However, when I run it, I get the following error:

Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/local/lib/python2.7/dist-packages/ws4py/server/wsgiutils.py", line 101, in __call__
    raise HandshakeError('Header %s is not defined' % key)
HandshakeError: Header HTTP_UPGRADE is not defined

This seems to be some weird header stuff that's a bit beyond my knowledge level and might not even be the fault of ws4py. Additionally, this isn't really that big of a deal, since the built-in CherryPy example works great, so I'm going to go with that for now. Just thought I would mention it for future reference.

@ghost
Copy link

ghost commented Jul 22, 2015

make change ' ' to 'localhost'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant