Bitcoin Forum
May 05, 2024, 05:50:05 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 [2]
21  Other / Beginners & Help / How to connect to MtGox streaming API through websocket? on: September 16, 2013, 01:27:45 PM
I'm trying to connect to it in my C++ app.

If I send a handshake to

http://socketio.mtgox.com:80/mtgox, it doesn't answer
http://websocket.mtgox.com:80/mtgox, it sends 400 Bad request

I Googled this one:

http://socketio.mtgox.com:80/socket.io/1/websocket, this one connects, switches to websocket protocol, then sends me two messages saying "1::" and "2::".

What do I do on my side?

I tried to send {"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe","op":"subscribe"} - nothing happens...


What's the right URL to connect and what do I send to subscribe to a channel?


Alternatively, can anyone please post a simple .js code that successfully connects to MtGox from a HTML page?

Without node.js or socket.io, just a built in HTML5 Websocket class.

I have this script:

Code:
<script language="javascript" type="text/javascript">

  var output;

  function init()
  {
    output = document.getElementById("output");
    testWebSocket();
  }

  function testWebSocket()
  {
    var websocket = new WebSocket('wss://socketio.mtgox.com:443/mtgox');
    websocket.onopen = function(evt) { onOpen(evt) };
    websocket.onclose = function(evt) { onClose(evt) };
    websocket.onmessage = function(evt) { onMessage(evt) };
    websocket.onerror = function(evt) { onError(evt) };
  }

  function onOpen(evt)
  {
    writeToScreen("CONNECTED");
    //doSend("WebSocket rocks");
  }

  function onClose(evt)
  {
    writeToScreen("DISCONNECTED");
  }

  function onMessage(evt)
  {
    writeToScreen('<span style="color: blue;">RESPONSE: ' + evt.data+'</span>');
  }

  function onError(evt)
  {
    writeToScreen('<span style="color: red;">ERROR:</span> ' + evt.data);
  }

  function doSend(message)
  {
    writeToScreen("SENT: " + message);
    websocket.send(message);
  }

  function writeToScreen(message)
  {
    var pre = document.createElement("p");
    pre.style.wordWrap = "break-word";
    pre.innerHTML = message;
    output.appendChild(pre);
  }

  window.addEventListener("load", init, false);

</script>

but it only prints ERROR: undefined and disconnects.


Thank you!
22  Economy / Services / Free MtGox trading platforms on: August 26, 2013, 11:21:44 PM
Are there any, for a web browser or a stand alone Windows app? Thanks!
23  Economy / Marketplace / Best way to convert BC to AUD? on: April 10, 2012, 03:02:45 PM
I've been away for a while, can someone please give me a heads up on the best (cheapest/secure) way to convert my BC into AUD?

Thanks!
24  Bitcoin / Mining / what is this number? on: February 16, 2011, 12:16:39 PM
when I run a pool miner a see messages which look like this:

16/02/2011 22:51, 3fd88eb3, accepted

what is this number, 3fd88eb3 ?
25  Bitcoin / Development & Technical Discussion / what miners are trying to resolve? on: February 13, 2011, 02:57:18 AM
Can anyone please point me to the info about what exactly needs to be solved to generate coins?

I'd like to see an example of a block, what the cryptographic problem is, and what the valid answer looks like

Thanks!
26  Bitcoin / Mining / Is Generate Coins option necessary? on: February 12, 2011, 03:19:23 PM
If I'm running a GPU miner, but I do not have "Generate Coins" option turned on in BitCoin, will it work normally and generate coins?

Or do I need to have it always turned on, regardless of GPU miner?
27  Economy / Marketplace / AUD to PayPal exchange on: February 12, 2011, 03:03:25 PM
Hi all,

I want to set some small exchange place for people using AUD

To start with, I want to buy up to 10 AUD worth of Bitcoins, at the rate 1 BTC = 1 AUD

The PayPal account is set in AUD, so as I understand there shouldn't be any PayPal fees involved in domestic transactions

Send me a PM if you are interested
28  Bitcoin / Mining / GPU mining pool? on: February 12, 2011, 08:57:44 AM
Hi all,

Is there currently a free GPU mining pool I could join?

Thanks!
Pages: « 1 [2]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!