|
July 24, 2013, 12:12:46 AM |
|
I am try to access the blockchain.info WebSocket API, but I can't get it to work. The connection opens, but then no messages are received. Can anyone give advice on what I'm doing wrong?
<html> <head> <script type="text/javascript"> var conn = new WebSocket('ws://ws.blockchain.info/inv'); conn.onopen = function () { console.log('open'); } conn.onclose = function () { console.log('close'); } conn.onerror = function (error) { console.log('websocket error: ' + error); } conn.onmessage = function (e) { console.log(e); } </script> </head> <body> </body> </html>
The console output is:
open close
|