Skip to content

Commit ecc77ec

Browse files
committed
Make Web-STOMP example use wss:// when in https://
1 parent 4258b65 commit ecc77ec

File tree

1 file changed

+2
-1
lines changed
  • deps/rabbitmq_web_stomp_examples/priv

1 file changed

+2
-1
lines changed

deps/rabbitmq_web_stomp_examples/priv/echo.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ <h2>Logs</h2>
7979
};
8080

8181
// Stomp.js boilerplate
82-
var client = Stomp.client('ws://' + window.location.hostname + ':15674/ws');
82+
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
83+
var client = Stomp.client(wsProtocol + '//' + window.location.hostname + ':15674/ws');
8384
client.debug = pipe('#second');
8485

8586
var print_first = pipe('#first', function(data) {

0 commit comments

Comments
 (0)