Bitcoin Forum
December 05, 2016, 04:40:28 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: « 1 2 3 4 5 [6] 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 »  All
  Print  
Author Topic: [BETA] MTGox websocket API, testers wanted  (Read 72212 times)
piotr_n
Legendary
*
Offline Offline

Activity: 1498


aka tonikt


View Profile WWW
September 20, 2011, 09:52:43 AM
 #101

The WebSocket API does not work with the latest Chrome. Sad

Chrome dev claims that the problem is at mtgox side.
Quote
It seems that websocket.mtgox.com is sending out a frame in old format (http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00). Chrome 14 uses new version WebSocket protocol (http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-08). We've dropped old protocol and are asking servers to adopt new one. mtgox is replying new version handshake correctly. Only new frame support looks broken.
http://code.google.com/p/chromium/issues/detail?id=97026

Please fix.

Check out gocoin - my original project of a bitcoin client written in Go, with some unique features.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
1480956028
Hero Member
*
Offline Offline

Posts: 1480956028

View Profile Personal Message (Offline)

Ignore
1480956028
Reply with quote  #2

1480956028
Report to moderator
1480956028
Hero Member
*
Offline Offline

Posts: 1480956028

View Profile Personal Message (Offline)

Ignore
1480956028
Reply with quote  #2

1480956028
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1480956028
Hero Member
*
Offline Offline

Posts: 1480956028

View Profile Personal Message (Offline)

Ignore
1480956028
Reply with quote  #2

1480956028
Report to moderator
1480956028
Hero Member
*
Offline Offline

Posts: 1480956028

View Profile Personal Message (Offline)

Ignore
1480956028
Reply with quote  #2

1480956028
Report to moderator
1480956028
Hero Member
*
Offline Offline

Posts: 1480956028

View Profile Personal Message (Offline)

Ignore
1480956028
Reply with quote  #2

1480956028
Report to moderator
AV
Hero Member
*****
Offline Offline

Activity: 910



View Profile
September 20, 2011, 12:56:57 PM
 #102

Hi, MagicalTux !

The WebSocket API really does not work with the latest (14.0.835.163) Chrome.


For example http://bitcoin.clarkmoody.com/
WebSocket Closed after 2 second.

Help ! Help ! Help !

Thanks.
speeder
Hero Member
*****
Offline Offline

Activity: 546



View Profile
September 20, 2011, 12:58:38 PM
 #103

Yay! Correct thread to complain about that!

Indeed, me too want clarkmoody on Chrome 14!

(thankfully at work Chrome is still stuck on 13)

bzzard
Sr. Member
****
Offline Offline

Activity: 398


View Profile WWW
September 22, 2011, 11:42:50 PM
 #104

yeah, this should work?
I know that ws://mtgoxlive.com:3456/channel works Tongue

MtGox! Anyone there?

BTCCharts.com - still for free!
paraipan
Legendary
*
Offline Offline

Activity: 924


Firstbits: 1pirata


View Profile WWW
September 24, 2011, 05:50:28 PM
 #105

sup MagicalTux, any plans to update websockets to draft-10 any time soon ? Thanks

BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
Ente
Legendary
*
Offline Offline

Activity: 1834



View Profile
September 25, 2011, 04:28:12 PM
 #106

I was going to make a nice interface for the feed as well, but I'm not going to bother until the problems are resolved:
Rounding issues
No perfect way to start out in-sync
Alleged missing data and dark pool inconsistencies

How about these and the wss://?
Its been months that Mark didnt post here now..

And, general question:
I chose this API as a starting project to learn ruby.  Maybe a bit (too) ambitious, but would at least be a useable project, if it ever gets finished..
Are there real advantages of this "new" websocket API over the old HTTP API except that I dont have to poll any more and have instant updates (instead of every 10 secs)? I would at least not have the syncing issues?

With the probably still unsolved issues I hesitate to invest much more time into this - being a novice I still am trying to actually post to the websocket.. *rolleyes*

Thanks,

Ente
Clark
Hero Member
*****
Offline Offline

Activity: 540


So much code.


View Profile WWW
October 10, 2011, 07:49:55 PM
 #107

I found the part of the draft where Chrome 14 is failing:

http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10#section-4.2

Apparently, MtGox is setting the RSV2 bit in the responses to the client. Thus, according to the spec, Chrome is required to FAIL the connection.

Using a packet sniffer, I can see the subscribed responses from the WebSocket after connecting, but the message never gets through and Chrome fails and closes the connection.

This is such a simple fix...

PGP KEY | 1Bitcoin3Tg2KWyAq3wzivdqwYqGwKYaGd
BkkCoins
Hero Member
*****
Offline Offline

Activity: 784


firstbits:1MinerQ


View Profile WWW
October 12, 2011, 06:43:21 AM
 #108

Does the "own" channel work at all?

I can't figure out how to get data about my own trades/orders. I've dumped all the data streamed and there is no data not matching the default channels. I tried subscribing using a key of my own account. That doesn't work either. It seems like this just doesn't work yet.

It would be really useful to see when your own orders/trades occur. If this does work then is there a web page somewhere that says more than the one line on the wiki?

*** Edit:

Another thing I noticed now is multi-currency trades coming thru. I don't quite understand these:

19:07:57 BUY  22.81 @ $2.63192 GBP
19:07:57 BUY  22.81 @ $25.6 CNY

I see British Pounds and Chinese Yuan. But why twice and how does this work - is someone buying with Pounds and settling in Yuan or something? I realize that this must be the same trade since the  GBPCNY exchange rate is now about 10.33. Just not sure how I can handle this as info if the USD isn't indicated.

Thx.

qxzn
Hero Member
*****
Offline Offline

Activity: 602



View Profile
October 12, 2011, 05:06:44 PM
 #109

I have not been able to get the "own" channel to work either. If anyone has, please share how!
Cluster2k
Legendary
*
Offline Offline

Activity: 1512


View Profile
October 16, 2011, 12:41:20 PM
 #110

Subscribing to my own channel doesn't work either.  I'm using VB and tried sending ANSI strings to MtGox in various formats, but as soon as I do I lose the TCP connection.  Sending the handshake right after connecting exactly the same way works fine however.

I have tried:

{'key': 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', 'op': 'mtgox.subscribe'}
{'key': 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', 'op': 'subscribe'}
{'op': 'mtgox.subscribe', 'key': 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'}
{'op': 'subscribe', 'key': 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'}

Sending nonsensical data "eg. 'testing 123' to the connection causes a disconnection as well.  Is this standard behaviour if MtGox doesn't recognise the message?

I assume the key is my key listed in my MtGox API section.  I have successfully used the key and secret to retrieve account data using a sample PHP script.

EDIT: Just tried using plain old telnet to connect to MtGox.  Works fine, just like this example:
http://dl.dropbox.com/u/24900303/screenshot/2011/04/20110415_websocket_telnet_example.png

But as soon as I try to send any subsequent data to the connection I lose it.  The wiki entry at https://en.bitcoin.it/wiki/MtGox/API is non descriptive. 

"Additionally each user has a "own" channel which streams informations about orders (new order, deleted order, etc) and trades only the user's trades). "

There is no description on how someone can subscribe to their own channel.

Do not send bitcoins to me: 16b8s7pBJ9rUmsExNW25qD5VUqVqRPZuXu
100% solar powered bitcoin generation
qxzn
Hero Member
*****
Offline Offline

Activity: 602



View Profile
October 16, 2011, 05:39:19 PM
 #111

You should not be getting a disconnect just for sending an invalid message type. You should be getting a json message back that says something about how your command was unrecognized. I would double check the bytes you're sending. As a test, you can try to unsubscribe to one of the feeds. That works, so you should be able to get it to work.
Cluster2k
Legendary
*
Offline Offline

Activity: 1512


View Profile
October 16, 2011, 10:56:54 PM
 #112

You should not be getting a disconnect just for sending an invalid message type. You should be getting a json message back that says something about how your command was unrecognized. I would double check the bytes you're sending. As a test, you can try to unsubscribe to one of the feeds. That works, so you should be able to get it to work.

It seems I can't send anything to MtGox after the initial handshake without getting disconnected.

I've tried in telnet too (MS Windows telnet client).  Surely it should work?

telnet websocket.mtgox.com 80
Sent the following text:
GET /mtgox HTTP/1.1
Upgrade: WebSocket
Connection: Upgrade
Host: websocket.mtgox.com
Origin: null

After pressing enter the second time I start to get the stream of data.

But when I try to send something like "{'op': 'mtgox.unsubscribe', 'key': 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe}" the connection is lost.  If I send anything at all the connection dies.

I don't get it.  

EDIT: Just tried it again with Putty on Win7.  Type of connection: raw.  Same result.  I can get the streaming data, but as soon as I try to send anything back to the server on the same connection it disconnects.

Do not send bitcoins to me: 16b8s7pBJ9rUmsExNW25qD5VUqVqRPZuXu
100% solar powered bitcoin generation
qxzn
Hero Member
*****
Offline Offline

Activity: 602



View Profile
October 17, 2011, 01:12:46 AM
 #113

You need to include certain bytes before and after every json message. I think no newlines. This would be hard to do in telnet. I suggest taking a hard look at this post which has haskell code that I think would still work:

https://bitcointalk.org/index.php?topic=5855.msg87198#msg87198
Cluster2k
Legendary
*
Offline Offline

Activity: 1512


View Profile
October 17, 2011, 01:26:20 AM
 #114

You need to include certain bytes before and after every json message. I think no newlines. This would be hard to do in telnet. I suggest taking a hard look at this post which has haskell code that I think would still work:

https://bitcointalk.org/index.php?topic=5855.msg87198#msg87198

Thanks for that.  I'll try putting \x00 before my message and \xFF after and see how that goes. 

Do not send bitcoins to me: 16b8s7pBJ9rUmsExNW25qD5VUqVqRPZuXu
100% solar powered bitcoin generation
Cluster2k
Legendary
*
Offline Offline

Activity: 1512


View Profile
October 17, 2011, 03:38:46 AM
 #115

You need to include certain bytes before and after every json message. I think no newlines. This would be hard to do in telnet. I suggest taking a hard look at this post which has haskell code that I think would still work:

https://bitcointalk.org/index.php?topic=5855.msg87198#msg87198

That works fine.  I wasn't sending the \x00 and \xFF at the beginning and end of each message.

I can successfully unsubscribe from the depth feed using:
{"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe","op":"unsubscribe"}

However when I try to resubscribe I get the following error:
{"message":"Unknown command","op":"remark","success":false}

I have tried all sorts of combinations of subscribe messages, but none seems to work.  I also can't subscribe to my own channel.

The following all fail:
{"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe","op":"subscribe"}
{"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe","op":"mtgox.subscribe"}
{"op":"subscribe","channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe"}
{"op":"mtgox.subscribe","channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe"}
{"op":"subscribe","24e67e0d-1cad-4cc0-9e7a-f8523ef460fe"}
{"op":"mtgox.subscribe","24e67e0d-1cad-4cc0-9e7a-f8523ef460fe"}

I looked at the haskell code and tried that subscription message first, then tried various other combinations.

hPutFrame h $ "{\"op\":\"mtgox.subscribe\"," ++ key ++ "}"

Do not send bitcoins to me: 16b8s7pBJ9rUmsExNW25qD5VUqVqRPZuXu
100% solar powered bitcoin generation
Cluster2k
Legendary
*
Offline Offline

Activity: 1512


View Profile
October 17, 2011, 07:33:09 AM
 #116

I have just been informed on #mtgox IRC that websockets are read-only.  Have been for a number of weeks.  Subscriptions don't work and it's not possible to view your own executed trades.

It's possible get around this limitation, but it really makes the system slow and a bit cumbersome to use.  It would be so much more convenient to get instant confirmation of your own trades.

Do not send bitcoins to me: 16b8s7pBJ9rUmsExNW25qD5VUqVqRPZuXu
100% solar powered bitcoin generation
Clark
Hero Member
*****
Offline Offline

Activity: 540


So much code.


View Profile WWW
October 20, 2011, 04:12:46 PM
 #117

I would like to see depth messages for all of the currencies broadcast out over the WebSocket, as I do not think it's happening right now.

Can anyone confirm that there are only USD depth messages coming across the socket?

PGP KEY | 1Bitcoin3Tg2KWyAq3wzivdqwYqGwKYaGd
molecular
Donator
Legendary
*
Offline Offline

Activity: 2128



View Profile
October 21, 2011, 01:23:06 PM
 #118

I would like to see depth messages for all of the currencies broadcast out over the WebSocket, as I do not think it's happening right now.

Can anyone confirm that there are only USD depth messages coming across the socket?

Looks like it's true. I am filtering for "depth_msg['currency'] == 'USD'", but put a debug log line for the other case. It doesn't trigger.

PGP key molecular F9B70769 fingerprint 9CDD C0D3 20F8 279F 6BE0  3F39 FC49 2362 F9B7 0769
Ente
Legendary
*
Offline Offline

Activity: 1834



View Profile
October 26, 2011, 03:29:34 PM
 #119

I am having problems with Websockets and Ruby in general, maybe someone of you is kind enough to help out?
I am beginner with Ruby and chose this as a learning-by-doing project.

Using examples from the web, I am still trying to connect to the websocket (works) and sending strings to it (handshake and channel subscription/exiting):

Code:
require 'rubygems' 'eventmachine' 'em-http-request'
 
EventMachine.run {
  verbindung = EventMachine::HttpRequest.new("http://websocket.mtgox.com").get :timeout => 0

  verbindung.errback { puts "oops" }
  verbindung.callback   {
    puts "WebSocket connected!"
                 
verbindung.send("GET /mtgox HTTP/1.1\n", 0)
  }
}

Error, my Ruby doesnt recognize "GET /mtgox HTTP/1.1\n" as a string to be "send" :

Code:
websocket.rb:19:in `send': undefined method `GET /mtgox HTTP/1.1 (NoMethodError)
' for #<EventMachine::HttpClient:0x7f9f6d22e8b8>

I tried "print", "send", "write", "<<", still didnt get it to work. I am lost, grateful for any hint!

Ente
runeks
Legendary
*
Offline Offline

Activity: 924



View Profile WWW
October 28, 2011, 09:13:22 PM
 #120

Anyone else getting timeouts connecting to ws://websocket.mtgox.com/mtgox? I am right now...
Pages: « 1 2 3 4 5 [6] 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!