Author

Topic: How to connect to MtGox streaming API through websocket? (Read 678 times)

member
Activity: 80
Merit: 11
I don't believe nobody here knows how to connect to MtGox via websockets.

Please tell me how you do it...
member
Activity: 80
Merit: 11
I'm trying to connect to it in my C++ app.

If I send a handshake to

http://socketio.mtgox.com:80/mtgox, it doesn't answer
http://websocket.mtgox.com:80/mtgox, it sends 400 Bad request

I Googled this one:

http://socketio.mtgox.com:80/socket.io/1/websocket, this one connects, switches to websocket protocol, then sends me two messages saying "1::" and "2::".

What do I do on my side?

I tried to send {"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe","op":"subscribe"} - nothing happens...


What's the right URL to connect and what do I send to subscribe to a channel?


Alternatively, can anyone please post a simple .js code that successfully connects to MtGox from a HTML page?

Without node.js or socket.io, just a built in HTML5 Websocket class.

I have this script:

Code:

but it only prints ERROR: undefined and disconnects.


Thank you!
Jump to: