We are trying to identify sockjs endpoints using Spring WebSocket Framework Support .
This is a server-side configuration where Jersey manages routes:
@Configuration
@EnableWebSocket
public class WebSocketConfig extends WebSocketMessageBrokerConfigurationSupport {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/sockjs").withSockJS()
.setStreamBytesLimit(512 * 1024)
.setHttpMessageCacheSize(1000)
.setDisconnectDelay(30 * 1000);
}
}
The problem is that we cannot access the /sockjs
client code:
List<Transport> transports = new ArrayList<>(2);
transports.add(new WebSocketTransport(new StandardWebSocketClient()));
transports.add(new RestTemplateXhrTransport());
SockJsClient sockJsClient = new SockJsClient(transports);
sockJsClient.doHandshake(new MyHandler(), "ws://localhost:8080/sockjs");
(code from spring website tutorial )
Other resources in the same package will be configured under root/api/server
, although not available /sockjs
and /root/api/server/sockjs
.
Noam source
share