jmesnil / stomp-websocket

Stomp client for Web browsers and node.js apps
http://jmesnil.net/stomp-websocket/doc/
Apache License 2.0
1.43k stars 586 forks source link

No error message, no connect under Node #97

Open joshvanderberg opened 9 years ago

joshvanderberg commented 9 years ago

Using the following script I get no error messages, and the script just exits silently under Node.js. It emits: connect Opening Web Socket...

This is using Node v0.10.35, Other versions:

stompjs@2.3.3 node_modules/stompjs └── websocket@1.0.14 (nan@1.0.0, debug@2.1.1, typedarray-to-buffer@3.0.1)

Now I know for certain that websocket endpoint involved does require authentication, and that I've not included the proper credentials in this script (note that including the proper credentials don't change the result), but I'd expect it would either trigger my error handler, or that the stomp client's log handler would show me something indicating an authentication error.

--- begin script ----- var Stomp = require('stompjs'); console.log('connect'); //Even uncommenting this results in zero error messages //stompClient = Stomp.overWS('fargle://tweet.foo.bar');

stompClient = Stomp.overWS('wss://test.yesenergy.com/PS/messaging/yes');

stompClient.debug = function(str) { console.log(str); };

stompClient.connect("dummy", "foo", function() { console.log('connectcallback'); }, function() { console.log('error'); } );

jmesnil commented 9 years ago

it's possible that you don't have any log if the broker fails during the WebSocket handshake (before stomp.js has the chance to report an error).

Which broker are you using? Do you have any error on the broker side? You could also debug the network packets to ensure that the WebSocket handshake is performed as expected.

joshvanderberg commented 9 years ago

Note that I get a similar result if I uncomment the gibberish address as well. No error message at all. Regardless I'd expect stomp to wrap any underlying websocket errors, and I recall it doing so in the browser. On Jan 4, 2015 11:33 AM, "Jeff Mesnil" notifications@github.com wrote:

it's possible that you don't have any log if the broker fails during the WebSocket handshake (before stomp.js has the chance to report an error).

Which broker are you using? Do you have any error on the broker side? You could also debug the network packets to ensure that the WebSocket handshake is performed as expected.

— Reply to this email directly or view it on GitHub https://github.com/jmesnil/stomp-websocket/issues/97#issuecomment-68641105 .