Skip to content

Commit

Permalink
Merge pull request #150 from kakao-tech-campus-2nd-step3/week10
Browse files Browse the repository at this point in the history
hotfix: 채팅 웹소켓 수정
  • Loading branch information
JaeBin2019 authored Nov 15, 2024
2 parents b247da9 + 7e626dd commit fdd89ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ public void addFormatters(FormatterRegistry registry) {
public void addCorsMappings(CorsRegistry corsRegistry) {
corsRegistry.addMapping("/**")
// 8080 추가
.allowedOrigins("http://localhost:5173", "http://localhost:8080",
"http://54.252.224.76:80", "http://54.252.224.76")
.allowedOrigins("http://localhost:5173",
"http://localhost:8080",
"http://54.252.224.76:80",
"http://54.252.224.76",
"http://52.79.80.3:8080")
.allowedMethods("GET", "POST", "PUT", "DELETE")
.allowedHeaders("*")
.allowCredentials(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ public WebSocketConfig(JwtUtil jwtUtil, MemberService memberService, ChatRoomSer
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
registry.addHandler(new ChatWebSocketHandler(chatRoomService), "/ws/chat/*")
.addInterceptors(new WebSocketHandshakeInterceptor(jwtUtil, memberService, chatRoomService, consultationService))
.setAllowedOrigins("http://localhost:8080", "http://localhost:5173", "http://54.252.224.76:80")
.withSockJS();
.setAllowedOrigins("http://localhost:8080",
"http://localhost:5173",
"http://54.252.224.76:80",
"http://52.79.80.3:8080")
;
}
}

0 comments on commit fdd89ad

Please sign in to comment.