Is there a way to connect to Eventlet via the WebSocket implementation in Firefox 6?
I can't seem to connect to an Eventlet server using the updated WebSocket implementation in Firefox 6 (MozWebSocket). The older implementation that was disabled by default would work fine as long as it was enabled. Is Eventlet's implementation incompatible with the updated WebSocket protocol that Firefox 6 uses?
On the client side, I see this in Firebug:
Firefox can't establish a connection to the server at ws://localhost:8888/stream?channel=q42nx.
Eventlet's output shows this:
127.0.0.1 - - [02/Sep/2011 16:19:42] "GET /chat HTTP/1.1" 400 103 0.001496
I'm testing with the websocket_chat.py example in the Eventlet examples folder. In the HTML file (websocket_chat.html), I changed the javascript on line 8 from
var s = new WebSocket("ws://127.0.0.1:%(port)s/chat");
var s = new MozWebSocket("ws://127.0.0.1:%(port)s/chat");
Try my library stargate. It's a little websocket utility library for eventlet and pyramid. https://github.com/boothead/stargate
精彩评论