MtGox appears to be doing origin filtering. Browser based WebSocket connections will have an origin header sent automatically with the value of the domain that the script is being run from. As this is primarily a security measure for browsers running potentially unknown Javascript code, WebSocket++ does not send an origin header by default.
MtGox appears to work fine with any origin that I have tried as long as one is set at all. Presumably they use this to blacklist origins that they deem malicious. You can send an origin header using WebSocket++ with the following code (Fill in whatever origin seems appropriate for your application):
con->replace_header("Origin","http://www.example.com");
Run this after you request your new connection with endpoint::get_connection
, but before calling endpoint::connect
.
See http://en.wikipedia.org/wiki/Same-origin_policy for more details about the 'same-origin policy' security method that is being used here.