notme
Legendary
Offline
Activity: 1904
Merit: 1002
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 13, 2012, 01:54:06 AM |
|
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.
|
|
|
|
zelyony
Newbie
Offline
Activity: 23
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 13, 2012, 09:37:48 PM |
|
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
Activity: 1904
Merit: 1002
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 13, 2012, 11:43:05 PM |
|
Thanks... I changed channel to type and subscribe to mtgox.subscribe and now it works.
|
|
|
|
Ente
Legendary
Offline
Activity: 2126
Merit: 1001
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 20, 2012, 04:44:26 PM |
|
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
Activity: 13
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 21, 2012, 08:57:16 AM |
|
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
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 21, 2012, 09:53:14 AM |
|
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](https://bitcointalk.org/Smileys/default/wink.gif)
|
|
|
|
rwcp97
Newbie
Offline
Activity: 13
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 21, 2012, 10:07:08 AM |
|
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](https://bitcointalk.org/Smileys/default/wink.gif) ok, I wasn't aware of that - I just connect to websocket.mtgox.com at port 80.
|
|
|
|
Ente
Legendary
Offline
Activity: 2126
Merit: 1001
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 21, 2012, 10:10:12 AM |
|
Thank you for the hints, rwcp and Fireball!
Ente
|
|
|
|
osmosis
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 25, 2012, 02:14:38 AM |
|
#> python socketio.py it should dump the messages to stdout
Thanks molecular.
|
|
|
|
is4tomj
Newbie
Offline
Activity: 48
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 25, 2012, 03:04:54 AM |
|
I'm using the streaming feed on my website. If anyone needs a working example feel free to take a look. ( http://BitcoinTitan.com)
|
|
|
|
molecular
Donator
Legendary
Offline
Activity: 2772
Merit: 1019
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 25, 2012, 10:03:34 AM |
|
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
Activity: 2053
Merit: 1356
aka tonikt
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 25, 2012, 01:14:54 PM |
|
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 full bitcoin node & cold wallet written in Go.PGP fingerprint: AB9E A551 E262 A87A 13BB 9059 1BE7 B545 CDF3 FD0E
|
|
|
osmosis
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 25, 2012, 01:32:01 PM |
|
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
Activity: 2053
Merit: 1356
aka tonikt
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 25, 2012, 01:34:50 PM |
|
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 full bitcoin node & cold wallet written in Go.PGP fingerprint: AB9E A551 E262 A87A 13BB 9059 1BE7 B545 CDF3 FD0E
|
|
|
piotr_n
Legendary
Offline
Activity: 2053
Merit: 1356
aka tonikt
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 25, 2012, 01:45:21 PM |
|
Or just try this page: http://websocket.org/echo.html... using i.e. ws://socketio.mtgox.com:80/socket.io/1/websocket/14001291971574386363and tell me that I'm crazy ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif)
|
Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.PGP fingerprint: AB9E A551 E262 A87A 13BB 9059 1BE7 B545 CDF3 FD0E
|
|
|
zelyony
Newbie
Offline
Activity: 23
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 26, 2012, 03:11:16 PM |
|
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
Activity: 2053
Merit: 1356
aka tonikt
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 26, 2012, 03:12:54 PM |
|
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 full bitcoin node & cold wallet written in Go.PGP fingerprint: AB9E A551 E262 A87A 13BB 9059 1BE7 B545 CDF3 FD0E
|
|
|
osmosis
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 27, 2012, 09:35:00 PM |
|
#> 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
Activity: 2126
Merit: 1001
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
February 13, 2012, 08:32:28 AM Last edit: February 14, 2012, 03:51:27 PM by Ente |
|
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: 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
Activity: 23
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
February 14, 2012, 05:57:55 PM |
|
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 #162datas 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](https://bitcointalk.org/Smileys/default/huh.gif)
|
|
|
|
|