Example usage for org.springframework.web.socket.sockjs.transport.handler DefaultSockJsService setSockJsClientLibraryUrl

List of usage examples for org.springframework.web.socket.sockjs.transport.handler DefaultSockJsService setSockJsClientLibraryUrl

Introduction

In this page you can find the example usage for org.springframework.web.socket.sockjs.transport.handler DefaultSockJsService setSockJsClientLibraryUrl.

Prototype

public void setSockJsClientLibraryUrl(String clientLibraryUrl) 

Source Link

Document

Transports with no native cross-domain communication (e.g.

Usage

From source file:org.bitcoinrt.spring.config.ServerConfig.java

@Bean
public SimpleUrlHandlerMapping handlerMapping() {

    DefaultSockJsService sockJsService = new DefaultSockJsService(sockJsTaskScheduler());
    sockJsService.setSockJsClientLibraryUrl("https://cdn.sockjs.org/sockjs-0.3.4.min.js");

    Map<String, Object> urlMap = new HashMap<String, Object>();
    urlMap.put("/websockets/**", new SockJsHttpRequestHandler(sockJsService, serverWebSocketHandler()));

    SimpleUrlHandlerMapping hm = new SimpleUrlHandlerMapping();
    hm.setOrder(-1);//from   w  w  w. j  a va2 s  . c o m
    hm.setUrlMap(urlMap);

    return hm;
}