Bitcoin Forum

Other => Beginners & Help => Topic started by: The General on May 08, 2013, 03:27:31 AM



Title: Mt Gox Web Socket Hair Pulling Out Situation
Post by: The General on May 08, 2013, 03:27:31 AM
Guys,

As I saw another post here in the Newbies section relating to web sockets and code, thought this was a good place for me (newbie) to post my question. I am having an issue with getting data returned from the web socket (i am using a version of Basic btw). So far, the below is the situation:

I can successfully initiate the handshake but am unable to subscribe to a channel and get some data returned. Below is the data being sent and the returned data and the area where I am having issues:

websocket.mtgox.com
GET /mtgox/Currency=USD HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Host: websocket.mtgox.com:80
Origin: websocket.mtgox.com:80
Sec-WebSocket-Key: UWaphFPiSqq3f2gOmaD5Sg==
Sec-WebSocket-Version: 13

RETURNS:

4{"message":"Now online (no channels)","op":"remark"}

Which is expected but when I try to initiate a subscribe, I just keep on getting disconnected:

\x00{"channel":"d5f06780-30a8-4a48-a2f8-7ed181b4a13f","op":"subscribe"}\xFF

Now, please be advised that I have put \x00 and \xFF in the above as I believe that is the correct notation for PHP and Python. As I am using Basic, I have set the first byte to 0 and the last to 255 and included the ANSI text above. Done the same with converting the JSON ANSI string above to UTF-8 but still no luck..Have tried to use Wireshark to get a handle on exactly what is being sent but my wireless hardware is not allowing promiscuous something or other.

Any pointers would be very helpful ! With my Basic version, I will have to handle any unicode etc conversions myself etc..

Am definitely slightly bolder after having started this exercise !

Cheers,

The General.


Title: Re: Mt Gox Web Socket Hair Pulling Out Situation
Post by: The General on May 08, 2013, 11:34:13 AM
A pint of cold beer for someone to pipe up !  ;D


Title: Re: Mt Gox Web Socket Hair Pulling Out Situation
Post by: The General on May 09, 2013, 05:22:20 AM
Two pints then !  ;D