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 587 forks source link

Stomp Over SSL #140

Open PikaChokeMe opened 7 years ago

PikaChokeMe commented 7 years ago

I can't seem to get this working with stomp over SSL and the more I look at it I'm not even sure it's supported.

I'm currently try to do

let wsProtocol = (location.protocol === 'https:') ? 'wss:' : 'ws:';
this.webSocketPath = `${wsProtocol}//${location.hostname}:${location.port}${webSocketPath}`;
this.stompClient = Stomp.client(this.webSocketPath);
this.stompClient.connect({login: '', passcode: ''}, this.connectCallback.bind(this));

But I get 400 errors on handshake. I've also tried using no port and port 443 explicitly but those have net me with a 404 not found.

dazed19 commented 7 years ago

Hi - I reliase you posted this a month ago. SSL via wss is definitely included as we are using - if you are getting a 404 I would suggest that the ssl part is working and the problem may be resolving the "$webSocketPath" on your server. Does this work with non-ssl (ws) mode?