Deprecated as of 5.0 a TaskScheduler is not provided upfront, not until it is obvious that it is needed; call SockJsServiceRegistration.getTaskScheduler() to check and then SockJsServiceRegistration.setTaskScheduler(TaskScheduler) to set it before a call to SockJsServiceRegistration.createSockJsService()
sockJsServiceRegistration.setClientLibraryUrl(this.sockJsServiceOptions.clientLibraryUrl);
@Override public void registerStompEndpoints(StompEndpointRegistry registry) { registry.addEndpoint("/websocket").withSockJS() .setClientLibraryUrl("http://0.0.0.0:9000/bower_components/sockjs/sockjs.js");; }
@Override public void registerStompEndpoints(StompEndpointRegistry registry) { registry.addEndpoint("/one-websocket") .addInterceptors(new HandShakeInterceptor()) .setAllowedOrigins("*") .withSockJS() // TODO 需要跟客户端的版本保持一致,如果是内网的话,需要修改配置 .setClientLibraryUrl("http://cdn.jsdelivr.net/sockjs/1/sockjs.min.js"); }
sockJsServiceRegistration.setClientLibraryUrl(this.sockJsServiceOptions.clientLibraryUrl);