From 2fe7a2a6b0b873cdefaa1533099071739d9d59e5 Mon Sep 17 00:00:00 2001 From: ronger Date: Fri, 26 Mar 2021 11:25:17 +0800 Subject: [PATCH] :bugs: websocket: https -> wss --- src/main/java/com/rymcu/forest/config/ShiroConfig.java | 1 + src/main/java/com/rymcu/forest/config/WebSocketStompConfig.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/com/rymcu/forest/config/ShiroConfig.java b/src/main/java/com/rymcu/forest/config/ShiroConfig.java index c539574..4b02b82 100644 --- a/src/main/java/com/rymcu/forest/config/ShiroConfig.java +++ b/src/main/java/com/rymcu/forest/config/ShiroConfig.java @@ -55,6 +55,7 @@ public class ShiroConfig implements EnvironmentAware { filterChainDefinitionMap.put("/api/**", "anon"); filterChainDefinitionMap.put("/ws/**", "anon"); + filterChainDefinitionMap.put("/wss/**", "anon"); filterChainDefinitionMap.put("/wx/**", "anon"); filterChainDefinitionMap.put("/**", "auth"); //配置shiro默认登录界面地址,前后端分离中登录界面跳转应由前端路由控制,后台仅返回json数据 diff --git a/src/main/java/com/rymcu/forest/config/WebSocketStompConfig.java b/src/main/java/com/rymcu/forest/config/WebSocketStompConfig.java index 3eb259f..acce4a8 100644 --- a/src/main/java/com/rymcu/forest/config/WebSocketStompConfig.java +++ b/src/main/java/com/rymcu/forest/config/WebSocketStompConfig.java @@ -20,6 +20,7 @@ public class WebSocketStompConfig implements WebSocketMessageBrokerConfigurer { public void registerStompEndpoints(StompEndpointRegistry registry) { // 允许使用socketJs方式访问 即可通过http://IP:PORT/ws来和服务端websocket连接 registry.addEndpoint("/ws").setAllowedOrigins("*").withSockJS(); + registry.addEndpoint("/wss").setAllowedOrigins("*").withSockJS(); } /**