views:

51

answers:

0

I'm trying to write a server for a webSocket connection. I've read the spec (76, not 75) carefully. I'm using minefield as the browser.

When I try to create a WebSocket from javascript in the browser:

var ws = new WebSocket("ws://localhost:8766/hoho");

The browser responds with

"Firefox can't establish a connection to the server at ws://localhost:8766/hoho."

My server is getting a valid client handshake request, it sends back the response and then boom.

I've run every example handshake example I can find through my server and I match the given responses exactly in every instance. I'm pretty confident that the return byte stream is correct. I don't need help debugging my code, it's doing what I mean it to do. I need help debugging my use of the handshake protocol since when I give minefield what I think is a correct response it laughs at me.

My question is this: How can I debug this thing? I can think of two possibilities.

  1. Is there any way to get minefield to tell me WHY it's rejecting my handshake?

  2. Is there a working, public, webSocket server service on the web? If there is, I can proxy it, watch the byte streams in both direction and figure out where mine is different.

Does anyone have any ideas in these directions or any other ideas?

Thanks for any help.