user3985: Here's a bit of node.js code:
var WebSocket = require('ws');
var ws = new WebSocket('ws://websocket.mtgox.com:80/mtgox?Currency=USD');
ws.on('open', function() {
    console.log('Connection opened');
    ws.send(JSON.stringify({ "op": "mtgox.subscribe", "type": "depth.BTCUSD" }));
});
ws.on('message', function(message) { console.log(message); });

When this client sends {"op": "mtgox.subscribe", "type": "depth.BTCUSD" } the API returns {"message":"Unknown mtgox message type","op":"remark","success":false}.
What am I doing wrong?

user4241: try using socket.io-client 
var io = require('socket.io-client');

then its as simple as 
var socket = io.connect( 'https://socketio.mtgox.com/mtgox' );

and then to subscribe to a specific channel 
var message = {
  "op": "subscribe",
  "channel": "24e67e0d-1cad-4cc0-9e7a-f8523ef460fe" // this is the market depth channel
};

socket.send(JSON.stringify(message));

socket.on('message', function(message) { console.log(message); });

should give you the results your looking for
I think your main problem is that your not using the channel id's in your connection message. Here is the Mtgox web sockets api which has a list of all the different channel id's. And heres a project which implements them generically. 
Hope this helps 

3985: <p>Here's a bit of node.js code:</p>



<pre><code>var WebSocket = require('ws');
var ws = new WebSocket('ws://websocket.mtgox.com:80/mtgox?Currency=USD');
ws.on('open', function() {
    console.log('Connection opened');
    ws.send(JSON.stringify({ "op": "mtgox.subscribe", "type": "depth.BTCUSD" }));
});
ws.on('message', function(message) { console.log(message); });
</code></pre>

<p>When this client sends <code>{"op": "mtgox.subscribe", "type": "depth.BTCUSD" }</code> the API returns <code>{"message":"Unknown mtgox message type","op":"remark","success":false}</code>.</p>

<p>What am I doing wrong?</p>
 4241: <p>try using socket.io-client </p>

<pre><code>var io = require('socket.io-client');
</code></pre>

<p>then its as simple as </p>

<pre><code>var socket = io.connect( 'https://socketio.mtgox.com/mtgox' );
</code></pre>

<p>and then to subscribe to a specific channel </p>

<pre><code>var message = {
  "op": "subscribe",
  "channel": "24e67e0d-1cad-4cc0-9e7a-f8523ef460fe" // this is the market depth channel
};

socket.send(JSON.stringify(message));

socket.on('message', function(message) { console.log(message); });
</code></pre>

<p>should give you the results your looking for</p>

<p>I think your main problem is that your not using the channel id's in your connection message. Here is the <a href="https://en.bitcoin.it/wiki/MtGox/API/Streaming#Incoming_Data" rel="nofollow">Mtgox web sockets api</a> which has a list of all the different channel id's. And heres a <a href="https://github.com/arthurpham/node-mtgox-socketio-client" rel="nofollow">project</a> which implements them generically. </p>

<p>Hope this helps </p>
