Hello to everybody,
I seem to be in struggle with the websockets in R. I wanted to download the
streaming data from the BitCoin exchange MtGox directly to R, but R cannot
establish the connection.
The websocket specs are defined as:
* Host: websocket.mtgox.com or socketio.mtgox.com
* Port: 80 or 443 ( ssl )
* Namespace: /mtgox (Including beginning slash)
url for more details: https://en.bitcoin.it/wiki/MtGox/API/Streaming
(https://en.bitcoin.it/wiki/MtGox/API/Streaming)
and my code is:
<code><span class='kwd'>require</span><span
class='pun'>(</span><span
class='pln'>websockets</span><span
class='pun'>)</span><span class='pln'>
con </span><span class='pun'>=</span><span
class='pln'> websocket</span><span
class='pun'>(</span><span
class='str'>"https://socketio.mtgox.com/mtgox"</span><span
class='pun'>,</span><span
class='pln'>port</span><span
class='pun'>=</span><span
class='lit'>443</span><span
class='pun'>)</span></code>
and I always end up with an error:
<code><span class='pun'>></span><span
class='pln'> con </span><span
class='pun'>=</span><span class='pln'>
websocket</span><span class='pun'>(</span><span
class='str'>"https://socketio.mtgox.com/mtgox"</span><span
class='pun'>,</span><span
class='pln'>port</span><span
class='pun'>=</span><span
class='lit'>443</span><span
class='pun'>)</span><span class='pln'>
</span><span class='typ'>Error</span><span
class='pln'> </span><span
class='kwd'>in</span><span class='pln'>
websocket</span><span class='pun'>(</span><span
class='str'>"https://socketio.mtgox.com/mtgox"</span><span
class='pun'>,</span><span class='pln'> port
</span><span class='pun'>=</span><span
class='pln'> </span><span
class='lit'>443</span><span
class='pun'>)</span><span class='pln'>
</span><span class='pun'>:</span><span
class='pln'>
</span><span class='typ'>Connection</span><span
class='pln'> error</span></code>
Does anyone have an idea what is wrong? I was informed that MtGox does not
use the proper websocket protocol but something called Socket-io.
Is it the reason why it doesn't work? If so, is there any other way to
handle socket-io in R? I searched all websockets packages but did not find
any.
Many thanks for help.
Stepan
[[alternative HTML version deleted]]