Notification Code.
This commit is contained in:
@@ -109,6 +109,7 @@ public class SecurityConfig {
|
||||
.requestMatchers("/v1/api-docs/**").permitAll() // API docs
|
||||
.requestMatchers("/v1/user/reset-password/initiate").permitAll()
|
||||
.requestMatchers("/v1/user/reset-password").permitAll()
|
||||
.requestMatchers("/wss/**").permitAll() // if this is not running use this /gs-guide-websocket
|
||||
.anyRequest().authenticated())
|
||||
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED))
|
||||
.exceptionHandling(exceptionHandling -> exceptionHandling
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package net.gepafin.tendermanagement.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
|
||||
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
|
||||
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
|
||||
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSocketMessageBroker
|
||||
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
|
||||
|
||||
@Override
|
||||
public void configureMessageBroker(MessageBrokerRegistry config) {
|
||||
// Enable a simple broker for both /topic (broadcast messages) and /queue (user-specific messages)
|
||||
config.enableStompBrokerRelay("/topic")
|
||||
.setRelayHost("localhost")
|
||||
.setRelayPort(61613) // RabbitMQ is running on port 61613
|
||||
.setClientLogin("guest")
|
||||
.setClientPasscode("guest");
|
||||
|
||||
// Prefix for application messages (user sends messages to /app endpoints)
|
||||
config.setApplicationDestinationPrefixes("/app");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerStompEndpoints(StompEndpointRegistry registry) {
|
||||
|
||||
registry.addEndpoint("/gs-guide-websocket").setAllowedOrigins("http://127.0.0.1:5501/", "http://localhost:5500", "http://localhost:5501", "http://127.0.0.1:5500/")
|
||||
.withSockJS();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user