我有正在工作的stomp websocket终结点:
@Configuration
@EnableWebSocketMessageBroker
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class WebSocketServerConfig implements WebSocketMessageBrokerConfigurer {
...
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("myStompEndpoint");
}
...
并希望添加websocket端点而不必跺脚:
@Configuration
@EnableWebSocket
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class WsServerConfig implements WebSocketConfigurer {
private final MyTextWsHandler myTextWsHandler;
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry webSocketHandlerRegistry) {
webSocketHandlerRegistry.addHandler(myTextWsHandler, "abcdef")
.addInterceptors(myHandshakeInterceptor());
}
}
现在stomp websocket的url是: ws://localhost:8080/myStompEndpoint
. 没有跺脚的websocket的url是什么?
暂无答案!
目前还没有任何答案,快来回答吧!