use of org.springframework.web.socket.client.standard.StandardWebSocketClient in project CVE-2018-1270 by CaledoniaProject.
the class ServiceClient method main.
public static void main(String... argv) {
WebSocketClient webSocketClient = new StandardWebSocketClient();
WebSocketStompClient stompClient = new WebSocketStompClient(webSocketClient);
stompClient.setMessageConverter(new MappingJackson2MessageConverter());
stompClient.setTaskScheduler(new ConcurrentTaskScheduler());
String url = "ws://127.0.0.1:8080/hello";
StompSessionHandler sessionHandler = new MySessionHandler();
stompClient.connect(url, sessionHandler);
// Don't close immediately.
new Scanner(System.in).nextLine();
}
use of org.springframework.web.socket.client.standard.StandardWebSocketClient in project yaps-client by serdaroquai.
the class WebsocketConfig method webSocketClient.
@Bean
public WebSocketStompClient webSocketClient(TaskScheduler taskScheduler) {
List<Transport> transports = new ArrayList<Transport>();
transports.add(new WebSocketTransport(new StandardWebSocketClient()));
WebSocketClient transport = new SockJsClient(transports);
WebSocketStompClient stompClient = new WebSocketStompClient(transport);
stompClient.setMessageConverter(new MappingJackson2MessageConverter());
// for heartbeats
stompClient.setTaskScheduler(taskScheduler);
return stompClient;
}
Aggregations