Skip to content

Commit 63cd18c

Browse files
committed
웹소켓
1 parent b9b53ad commit 63cd18c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/com/oronaminc/join/websocket/config/WebSocketConfig.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
1010
import org.springframework.web.socket.config.annotation.WebSocketTransportRegistration;
1111
import org.springframework.web.socket.handler.WebSocketHandlerDecoratorFactory;
12+
import org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor;
1213

1314
import com.oronaminc.join.websocket.handshake.CustomHandshakeHandler;
1415
import com.oronaminc.join.websocket.session.CustomWebSocketHandlerDecorator;
@@ -47,15 +48,15 @@ public void registerStompEndpoints(StompEndpointRegistry registry) {
4748
registry.addEndpoint("/ws")
4849
.setAllowedOriginPatterns("*")
4950
// websocket 연결 전 쿠키 체크
50-
// .addInterceptors(new HttpSessionHandshakeInterceptor())
51+
.addInterceptors(new HttpSessionHandshakeInterceptor())
5152
// websocket 연결 후 principal 생성
52-
// .setHandshakeHandler(handshakeHandler)
53+
.setHandshakeHandler(handshakeHandler)
5354
.withSockJS();
5455

5556
registry.addEndpoint("/ws")
5657
.setAllowedOriginPatterns("*")
57-
// .addInterceptors(new HttpSessionHandshakeInterceptor())
58-
// .setHandshakeHandler(handshakeHandler)
58+
.addInterceptors(new HttpSessionHandshakeInterceptor())
59+
.setHandshakeHandler(handshakeHandler)
5960
;
6061

6162
registry.setErrorHandler(stompErrorHandler);

0 commit comments

Comments
 (0)