Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketTransportRegistration;
import org.springframework.web.socket.handler.WebSocketHandlerDecoratorFactory;
import org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor;

import com.oronaminc.join.websocket.handshake.CustomHandshakeHandler;
import com.oronaminc.join.websocket.session.CustomWebSocketHandlerDecorator;
Expand Down Expand Up @@ -49,9 +50,9 @@ public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/ws")
.setAllowedOriginPatterns("*")
// websocket 연결 전 쿠키 체크
// .addInterceptors(new HttpSessionHandshakeInterceptor())
.addInterceptors(new HttpSessionHandshakeInterceptor())
// websocket 연결 후 principal 생성
// .setHandshakeHandler(handshakeHandler)
.setHandshakeHandler(handshakeHandler)
.withSockJS();

registry.addEndpoint("/ws")
Expand Down