Bitcoin Forum
December 02, 2016, 10:36:42 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 72188 times)
notme
Legendary
*
Offline Offline

Activity: 1526


View Profile
January 13, 2012, 01:54:06 AM
 #161

I'm trying to connect via the SocketIO Ruby gem.  When I try to subscribe to the trades channel the following string is passed to the server: ""\x003:::{\"channel\":\"dbf1dee9-4f2e-4a08-8cb7-748919a71b21\",\"op\":\"subscribe\"}\xFF".  The server response with a json message: {"op":"remark","success":false,"message":"Unknown command","debug":{"op":"client","uuid":"5a1f3b8f-1e03-462b-bd38-e463bb39ff2e","data":{"channel":"dbf1dee9-4f2e-4a08-8cb7-748919a71b21","op":"subscribe"}}}

The "data" field seems to be the message I intended to submit, but the subscribe fails with "Unknown command".  Any help would be appreciated.

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
12jh3odyAAaR2XedPKZNCR4X4sebuotQzN
1480718202
Hero Member
*
Offline Offline

Posts: 1480718202

View Profile Personal Message (Offline)

Ignore
1480718202
Reply with quote  #2

1480718202
Report to moderator
1480718202
Hero Member
*
Offline Offline

Posts: 1480718202

View Profile Personal Message (Offline)

Ignore
1480718202
Reply with quote  #2

1480718202
Report to moderator
1480718202
Hero Member
*
Offline Offline

Posts: 1480718202

View Profile Personal Message (Offline)

Ignore
1480718202
Reply with quote  #2

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

Activity: 23



View Profile
January 13, 2012, 09:37:48 PM
 #162

The "data" field seems to be the message I intended to submit, but the subscribe fails with "Unknown command".  Any help would be appreciated.
my subscribtions (raw socket.io messages over websocket - no explicit frames borders) are:
   "4:::{"op":"mtgox.subscribe","type":"trades"}"
   "4:::{"op":"mtgox.subscribe","type":"ticker"}"
   "4:::{"op":"mtgox.subscribe","type":"depth"}"
notme
Legendary
*
Offline Offline

Activity: 1526


View Profile
January 13, 2012, 11:43:05 PM
 #163

Thanks... I changed channel to type and subscribe to mtgox.subscribe and now it works.

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
12jh3odyAAaR2XedPKZNCR4X4sebuotQzN
Ente
Legendary
*
Offline Offline

Activity: 1834



View Profile
January 20, 2012, 04:44:26 PM
 #164

Is it possible to query my open trades and/or cancel an order or at least all orders? With the websocket API, that is?
Didnt see any hint that this is possible..

But then I dont remember to have ever seen the commands to post orders via websocket neither?

Is the websocket for "reading" only, like making graphs from the data?

edit:
So, get data from the websocket, and exectue/cancel orders via "API version 1" then?

Ente
rwcp97
Newbie
*
Offline Offline

Activity: 13


View Profile
January 21, 2012, 08:57:16 AM
 #165

Is it possible to query my open trades and/or cancel an order or at least all orders? With the websocket API, that is?
Didnt see any hint that this is possible..

But then I dont remember to have ever seen the commands to post orders via websocket neither?

Is the websocket for "reading" only, like making graphs from the data?

edit:
So, get data from the websocket, and exectue/cancel orders via "API version 1" then?

Ente

As far as I know there is no possibility to do orders over the websocket... Would be pretty dangerous too, as it isn't SSL encrypted.
But you can subscribe to your "private channel" to be informed about your orders. Use getKey.php to get its name.
Fireball
Hero Member
*****
Offline Offline

Activity: 673


View Profile WWW
January 21, 2012, 09:53:14 AM
 #166

As far as I know there is no possibility to do orders over the websocket... Would be pretty dangerous too, as it isn't SSL encrypted.
But you can subscribe to your "private channel" to be informed about your orders. Use getKey.php to get its name.

socket.io supports secure connections (https, wss transports). That's what I use in ICBIT trading platform, so I would be quite surprised if that's dangerous Wink

Margin trading platform OrderBook.net (ICBIT): https://orderbook.net
Follow us in Twitter: https://twitter.com/orderbooknet
rwcp97
Newbie
*
Offline Offline

Activity: 13


View Profile
January 21, 2012, 10:07:08 AM
 #167

socket.io supports secure connections (https, wss transports). That's what I use in ICBIT trading platform, so I would be quite surprised if that's dangerous Wink

ok, I wasn't aware of that - I just connect to websocket.mtgox.com at port 80.
Ente
Legendary
*
Offline Offline

Activity: 1834



View Profile
January 21, 2012, 10:10:12 AM
 #168

Thank you for the hints, rwcp and Fireball!

Ente
osmosis
Sr. Member
****
Offline Offline

Activity: 301



View Profile
January 25, 2012, 02:14:38 AM
 #169

 #> python socketio.py
it should dump the messages to stdout

Thanks molecular.
is4tomj
Jr. Member
*
Offline Offline

Activity: 48



View Profile WWW
January 25, 2012, 03:04:54 AM
 #170

I'm using the streaming feed on my website.  If anyone needs a working example feel free to take a look. (http://BitcoinTitan.com)

http://BitcoinTitan.com - Visualizations of the Bitcoin Markets and Exchanges
molecular
Donator
Legendary
*
Offline Offline

Activity: 2128



View Profile
January 25, 2012, 10:03:34 AM
 #171

Let me say here that the socket.io/websocket feed has been rather stable in late times. I'm hoping this has nothing to do with the fact that trading volume is declining, but is due to Magicaltux making things better. In that case: thanks, Magicaltux and/or mtgox team.

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

Activity: 1498


aka tonikt


View Profile WWW
January 25, 2012, 01:14:54 PM
 #172

I don't know guys how you can be using this new socket.io via the websocket interface...

I get my ID nicely from https://socketio.mtgox.com/socket.io/1/ but then after I connect my websocket lib to ws://socketio.mtgox.com:80/socket.io/1/websocket/XXXXX - it just sends me "7:::1+0" and disconnects immediately after that.

Am I the only one who has this problem?

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
osmosis
Sr. Member
****
Offline Offline

Activity: 301



View Profile
January 25, 2012, 01:32:01 PM
 #173

I don't know guys how you can be using this new socket.io via the websocket interface...

I get my ID nicely from https://socketio.mtgox.com/socket.io/1/ but then after I connect my websocket lib to ws://socketio.mtgox.com:80/socket.io/1/websocket/XXXXX - it just sends me "7:::1+0" and disconnects immediately after that.

Am I the only one who has this problem?

Works for me. Sounds like an issue on your side.
piotr_n
Legendary
*
Offline Offline

Activity: 1498


aka tonikt


View Profile WWW
January 25, 2012, 01:34:50 PM
 #174

I don't know guys how you can be using this new socket.io via the websocket interface...

I get my ID nicely from https://socketio.mtgox.com/socket.io/1/ but then after I connect my websocket lib to ws://socketio.mtgox.com:80/socket.io/1/websocket/XXXXX - it just sends me "7:::1+0" and disconnects immediately after that.

Am I the only one who has this problem?

Works for me. Sounds like an issue on your side.
But which language / websocket library do you use?

I tried with latest Chrome and this extension: https://chrome.google.com/webstore/detail/pfdhoblngboilpfeibdedpjgfnlcodoo
.... and also tried with websocket package from Go - and they both disconnect me immediately after sending "7:::1+0"

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
piotr_n
Legendary
*
Offline Offline

Activity: 1498


aka tonikt


View Profile WWW
January 25, 2012, 01:45:21 PM
 #175

Or just try this page: http://websocket.org/echo.html
... using i.e.  ws://socketio.mtgox.com:80/socket.io/1/websocket/14001291971574386363
and tell me that I'm crazy Smiley

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
zelyony
Newbie
*
Offline Offline

Activity: 23



View Profile
January 26, 2012, 03:11:16 PM
 #176

I get my ID nicely from https://socketio.mtgox.com/socket.io/1/ but then after I connect my websocket lib to ws://socketio.mtgox.com:80/socket.io/1/websocket/XXXXX - it just sends me "7:::1+0" and disconnects immediately after that.
If u got ID from https:// than u must connect to wss:// with this ID (SSL/TLS - secure connection)
and if http:// than ws://
piotr_n
Legendary
*
Offline Offline

Activity: 1498


aka tonikt


View Profile WWW
January 26, 2012, 03:12:54 PM
 #177

I get my ID nicely from https://socketio.mtgox.com/socket.io/1/ but then after I connect my websocket lib to ws://socketio.mtgox.com:80/socket.io/1/websocket/XXXXX - it just sends me "7:::1+0" and disconnects immediately after that.
If u got ID from https:// than u must connect to wss:// with this ID (SSL/TLS - secure connection)
and if http:// than ws://
shit man.
thank you!!!
that was indeed the problem.

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
osmosis
Sr. Member
****
Offline Offline

Activity: 301



View Profile
January 27, 2012, 09:35:00 PM
 #178

 #> python socketio.py
it should dump the messages to stdout

Thanks molecular.

For the websocket in python, anyone find a way to deal with the disconnect errors?

File "/home/osmosis/proj_venv/proj_proj/websocket_client.py", line 161, in recv
SSLError: [Errno 1] _ssl.c:1325: error:14095044:SSL routines:SSL3_READ_N:internal error
SSLError: [Errno 1] _ssl.c:1325: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac
SSLError: [Errno 1] _ssl.c:1325: error:1408F096:SSL routines:SSL3_GET_RECORD:encrypted length too long
SSLError: [Errno 1] _ssl.c:1325: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
SSLError: [Errno 8] _ssl.c:1325: EOF occurred in violation of protocol
ConnectionClosedException
Ente
Legendary
*
Offline Offline

Activity: 1834



View Profile
February 13, 2012, 08:32:28 AM
 #179

TL;DR:
Will ws://websocket.mtgox.com/mtgox continue to work?


Some days ago I connected to the old, deprecated websocket. Connecting works, but no data comes in any more.

Now thats an incentive to figure out socket.io :-)

edit:

As far as I know there is no possibility to do orders over the websocket...

Seems like now you can indeed do orders over socket.io:

Quote from: Bitcoin Wiki link=https://en.bitcoin.it/wiki/MtGox/API#Streaming_API
Authenticated commands
These commands require an API key and secret pair to sign requests. Any of the "version 1" requests from the HTTP API can be called.

So I got the handshake coded, getting me my connection-ID. I then can connect to the websocket just fine.
However, I dont receive any data, only two messages: '1::' and '2::'. Both come once in the first few seconds of being connected, then total silence. I am not being disconnected neither, I think.
Do I have to join a channel? Or am I connected to the default channels just like before?
I dont have "sending messages" finished yet to test..

Any hints?

Ente

zelyony
Newbie
*
Offline Offline

Activity: 23



View Profile
February 14, 2012, 05:57:55 PM
 #180

So I got the handshake coded, getting me my connection-ID. I then can connect to the websocket just fine.
However, I dont receive any data, only two messages: '1::' and '2::'. Both come once in the first few seconds of being connected, then total silence. I am not being disconnected neither, I think.
Do I have to join a channel? Or am I connected to the default channels just like before?
I dont have "sending messages" finished yet to test..
Any hints?
in the past (3+ weeks ago):
by default u dont subscribed to channels
u may send simple strings over internal (socket.io's) websocket
for "2::" u must send "2::" (or send "2::" every 15secs)
for subscribe u must send post #162
datas stopped in socket after 3-15min.. u can open & sync 2 socket.io..
for now:
post #162 looks no more working - no datas except "1::" & "2::"
Huh
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!