Use plain WebSockets, not SockJS
This commit is contained in:
parent
0da01c32d2
commit
e667be1bab
@ -32,7 +32,8 @@ public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerStompEndpoints(StompEndpointRegistry registry) {
|
public void registerStompEndpoints(StompEndpointRegistry registry) {
|
||||||
registry.addEndpoint("/stomp").withSockJS();
|
registry.addEndpoint("/sockjs").withSockJS();
|
||||||
|
registry.addEndpoint("/stomp");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -274,7 +274,12 @@ function afterConnected(stompConnectedFrame) {
|
|||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
|
|
||||||
client = Stomp.over(new SockJS('/stomp'));
|
let webSocketProtocol = 'ws';
|
||||||
|
if (location.protocol.startsWith('https')) {
|
||||||
|
webSocketProtocol = 'wss';
|
||||||
|
}
|
||||||
|
|
||||||
|
client = Stomp.client(`${webSocketProtocol}://${location.host}/stomp`);
|
||||||
client.connect({}, afterConnected, function(errorMessage) {
|
client.connect({}, afterConnected, function(errorMessage) {
|
||||||
addChatAnnouncement(errorMessage);
|
addChatAnnouncement(errorMessage);
|
||||||
addChatAnnouncement('Please reload the page!');
|
addChatAnnouncement('Please reload the page!');
|
||||||
|
@ -32,7 +32,12 @@ function start() {
|
|||||||
reset();
|
reset();
|
||||||
repaint();
|
repaint();
|
||||||
|
|
||||||
client = Stomp.over(new SockJS('/stomp'));
|
let webSocketProtocol = 'ws';
|
||||||
|
if (location.protocol.startsWith('https')) {
|
||||||
|
webSocketProtocol = 'wss';
|
||||||
|
}
|
||||||
|
|
||||||
|
client = Stomp.client(`${webSocketProtocol}://${location.host}/stomp`);
|
||||||
|
|
||||||
client.connect({}, function(frame) {
|
client.connect({}, function(frame) {
|
||||||
subscribeToPracticeGame();
|
subscribeToPracticeGame();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user