r - websocket connection does not work -


i seem in struggle websockets in r. wanted download streaming data bitcoin exchange mtgox directly r, r cannot establish connection.

the websocket specs defined as:

  • host: websocket.mtgox.com or socketio.mtgox.com
  • port: 80 or 443 ( ssl )
  • namespace: /mtgox (including beginning slash)

url more details: https://en.bitcoin.it/wiki/mtgox/api/streaming

and code is:

require(websockets) con = websocket("https://socketio.mtgox.com/mtgox",port=443) 

and end error:

> con = websocket("https://socketio.mtgox.com/mtgox",port=443) error in websocket("https://socketio.mtgox.com/mtgox", port = 443) :  connection error 

does have idea wrong?

many thanks.

i've looked @ source code , manual here - https://github.com/rstudio/r-websockets

the r websocket library out of date , not compliant websocket protocol stands.

so you'd need fix library or find alternate one. fixing library isn't hard depending on ability. managed here -

https://github.com/zeenogee/r-websockets

my 1 (lazily) hard-coded mtgox - use @ own risk! you'd need remove current websocket library , install one. don't forget code doing basic connection. there couple more steps see actual data -

set_callback("receive", function(data,ws,header) cat(rawtochar(data)), con) service (con) 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -