Java 类org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry 实例源码

项目:BIMplatform    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {

       /** 
        * 支持websocket 的 connection 
        */  
       registry.addHandler(binaryGeometryTemplateSocketHandler,"/ws/binarygeometry/template").setAllowedOrigins("*").addInterceptors(new BinaryGeometryTemplateInterceptor()); 

       /** 
        * 如不支持websocket的connenction,采用sockjs 
        */  
       registry.addHandler(geometrySocketHandler,"/ws/geometry").setAllowedOrigins("*").addInterceptors(new GeometryInterceptor());
       //.withSockJS();

        registry.addHandler(streamGeometrySocketHandler,"/ws/streamgeometry").setAllowedOrigins("*").addInterceptors(new StreamGeometryInterceptor());
}
项目:steve-plugsurfing    文件:WebSocketConfiguration.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    WebSocketPolicy policy = new WebSocketPolicy(WebSocketBehavior.SERVER);
    policy.setMaxTextMessageBufferSize(MAX_MSG_SIZE);
    policy.setMaxTextMessageSize(MAX_MSG_SIZE);
    policy.setIdleTimeout(IDLE_TIMEOUT);

    OcppWebSocketUpgrader upgradeStrategy = new OcppWebSocketUpgrader(
            policy, ocpp12WebSocketEndpoint, ocpp15WebSocketEndpoint, chargePointRepository);

    DefaultHandshakeHandler handler = new DefaultHandshakeHandler(upgradeStrategy);
    handler.setSupportedProtocols(PROTOCOLS);

    registry.addHandler(ocpp12WebSocketEndpoint, "/websocket/CentralSystemService/*")
            .addHandler(ocpp15WebSocketEndpoint, "/websocket/CentralSystemService/*")
            .setHandshakeHandler(handler)
            .setAllowedOrigins("*");
}
项目:example-restful-project    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry
        .addHandler(notificationHandler(), "/teapots")
        .addHandler(teapotHandler(), "/teapots/register/{teapotId}")
        .addHandler(consoleHandler(), "/teapots/{teapotId}")
        .setAllowedOrigins("*")    // allow all origins
        .addInterceptors(new UriTemplateHandshakeInterceptor());
}
项目:steve    文件:WebSocketConfiguration.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    WebSocketPolicy policy = new WebSocketPolicy(WebSocketBehavior.SERVER);
    policy.setMaxTextMessageBufferSize(MAX_MSG_SIZE);
    policy.setMaxTextMessageSize(MAX_MSG_SIZE);
    policy.setIdleTimeout(IDLE_TIMEOUT);

    OcppWebSocketUpgrader upgradeStrategy = new OcppWebSocketUpgrader(
            policy, ocpp12WebSocketEndpoint, ocpp15WebSocketEndpoint, chargePointRepository, notificationService);

    DefaultHandshakeHandler handler = new DefaultHandshakeHandler(upgradeStrategy);
    handler.setSupportedProtocols(PROTOCOLS);

    registry.addHandler(ocpp12WebSocketEndpoint, "/websocket/CentralSystemService/*")
            .addHandler(ocpp15WebSocketEndpoint, "/websocket/CentralSystemService/*")
            .setHandshakeHandler(handler)
            .setAllowedOrigins("*");
}
项目:train-simulator    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
  if (AppConfig.isNonInteractive) {
    return;
  }
  registry.addHandler(new WebSocketHandler(), "/ws").withSockJS()
      .setClientLibraryUrl("https://cdn.jsdelivr.net/sockjs/1.1.4/sockjs.min.js");
}
项目:Instant-Messaging    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(myHandler(), "/ws")
            .addInterceptors(new HandshakeInterceptor());
    registry.addHandler(myHandler(), "/ws/sockjs")
            .addInterceptors(new HandshakeInterceptor()).withSockJS();
}
项目:telemarket-skittle-alley    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    String[] beans = context.getBeanNamesForAnnotation(WSHandler.class);
    for (String bean : beans) {
        WebSocketHandler handler = context.getBean(bean, WebSocketHandler.class);
        String[] path = handler.getClass().getAnnotation(WSHandler.class).value();
        registry.addHandler(handler, path).setAllowedOrigins("*").withSockJS();
        LOGGER.info("[WebSocket]注册 WebSocket path {} 到 {}", path, bean);
    }
}
项目:broadcast_server    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    MessageRouter jsonMessageRouter = this.jsonMessageRouter();

    registry.addHandler(jsonMessageRouter, "/ws")
            .addInterceptors(httpSessionHandshakeInterceptor())
            .setAllowedOrigins("*");

    jsonMessageRouter.addHandler(serverMessageHandler());
}
项目:hsweb-framework    文件:CommandWebSocketAutoConfiguration.java   
@Override
protected void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    CommandWebSocketMessageDispatcher dispatcher = new CommandWebSocketMessageDispatcher();
    dispatcher.setProcessorContainer(commandProcessorContainer);
    dispatcher.setUserTokenManager(userTokenManager);
    dispatcher.setWebSocketSessionListeners(webSocketSessionListeners);
    dispatcher.setTokenParsers(webSocketTokenParsers);
    registry.addHandler(dispatcher, "/sockjs")
            .setAllowedOrigins(allowedOrigins)
            .withSockJS()
            .setSessionCookieNeeded(true);
    registry.addHandler(dispatcher, "/socket")
            .setAllowedOrigins(allowedOrigins);
}
项目:tenorite    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry
        .addHandler(spectateWebSocketHandler(), "/ws/spectate")
        .withSockJS()
        .setInterceptors(spectateHandshakeInterceptor());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SampleUndertowWebSocketsApplication.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(echoWebSocketHandler(), "/echo").setAllowedOrigins("*")
            .withSockJS();
    registry.addHandler(snakeWebSocketHandler(), "/snake").setAllowedOrigins("*")
            .withSockJS();
}
项目:spring-boot-concourse    文件:SampleUndertowWebSocketsApplication.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(echoWebSocketHandler(), "/echo").setAllowedOrigins("*")
            .withSockJS();
    registry.addHandler(snakeWebSocketHandler(), "/snake").setAllowedOrigins("*")
            .withSockJS();
}
项目:contestparser    文件:SampleUndertowWebSocketsApplication.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(echoWebSocketHandler(), "/echo").setAllowedOrigins("*")
            .withSockJS();
    registry.addHandler(snakeWebSocketHandler(), "/snake").setAllowedOrigins("*")
            .withSockJS();
}
项目:ready-websocket-plugin    文件:SampleWebSocketsApplication.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(echoWebSocketHandler(), "/echo").setAllowedOrigins("*").withSockJS();
    registry.addHandler(greetingWebSocketHandler(), "/hello").setAllowedOrigins("*").withSockJS();
    registry.addHandler(closeWithCodeWebSocketHandler(), "/code").setAllowedOrigins("*").withSockJS();
    registry.addHandler(randomByteStreamWebSocketHandler(), "/stream").setAllowedOrigins("*").withSockJS();
}
项目:gameboot    文件:OtpWebSocketTestConfiguration.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
  //@formatter:off
  registry
    .addHandler(clearHandler, clrPath)
    .addHandler(encHandler, encPath)
    .addInterceptors(new HttpSessionHandshakeInterceptor())
    .setHandshakeHandler(createHandshakeHandler());
  //@formatter:on
}
项目:pinpoint    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    final String[] allowedOriginArray = getAllowedOriginArray(configProperties.getWebSocketAllowedOrigins());

    for (PinpointWebSocketHandler handler : handlerRepository.getWebSocketHandlerRepository()) {
        String path = handler.getRequestMapping() + WEBSOCKET_SUFFIX;
        final WebSocketHandlerRegistration webSocketHandlerRegistration = registry.addHandler(handler, path);

        webSocketHandlerRegistration.addInterceptors(new HttpSessionHandshakeInterceptor());
        webSocketHandlerRegistration.addInterceptors(new WebSocketSessionContextPrepareHandshakeInterceptor());
        webSocketHandlerRegistration.setAllowedOrigins(allowedOriginArray);
    }
}
项目:Spring-5.0-Cookbook    文件:ChatSocketConfig.java   
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(new HotlineSocketHandler(), "/data");
}
项目:TLIVideoConferencingv2    文件:GroupCallApp.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
  registry.addHandler(groupCallHandler(), "/groupcall");
}
项目:TLIVideoConferencingv2    文件:One2ManyCallApp.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
  registry.addHandler(callHandler(), "/call").setAllowedOrigins("*");
}
项目:La-Apostada    文件:WebsocketConfiguration.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(websocketCuotaHandler, "/websocket/cuotas")
            .setAllowedOrigins("*");
}
项目:tmply    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry)
{
    registry.addHandler(webSocketHandler, "/api/ws").setAllowedOrigins("*");
}
项目:conf-modern-devops-k8s    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(new WebSocketHandler(), "/web-socket")
            .setAllowedOrigins("*");
}
项目:javametrics    文件:JavametricsSpringConfigurer.java   
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(new JavametricsSpringSocketHandler(), "javametrics-dash/javametrics-socket");
}
项目:karate    文件:MainConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    logger.debug("register websocket handlers: {}", registry);
}
项目:RedisClusterManager    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(slotMoveHandle, "/slot_move");
    registry.addHandler(redisInstallHandle, "/install");
    registry.addHandler(createClusterHandle, "/create");
}
项目:cloudterm    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry
            .addHandler(terminalSocket(), "/terminal");
}
项目:flow-platform    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    WebSocketHandler webSocketHandler = cmdLoggingConsumer();
    registry.addHandler(webSocketHandler, URL_FOR_AGENT_CMD_LOGGING).setAllowedOrigins("*");
}
项目:simpleblockchain    文件:BitcoinApplication.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
}
项目:proxyee-down    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
  registry.addHandler(progressHandle(), "/ws/onProgress");
}
项目:sc-generator    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(redisTextWebSocketHandler,"/ws/redis")
            .addHandler(mysqlTextWebSocketHandler,"/ws/mysql");
}
项目:Learning-Spring-5.0    文件:MyWebSocketConfigurer_sockjs.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(myHandler(), "/myHandler_sockjs").setAllowedOrigins("*").withSockJS();

}
项目:Learning-Spring-5.0    文件:MyWebSocketConfigurer.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(myHandler(), "/myHandler").setAllowedOrigins("*");

}
项目:travel-agency    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(myHandler(), "/vapi").setAllowedOrigins("*");
    registry.addHandler(browser(), "/browser").setAllowedOrigins("*");
}
项目:java-websocket-reverse-proxy    文件:ProxyWebSocketConfigurer.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(new WebSocketProxyServerHandler(), "/");
}
项目:stubmarine    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry
            .addHandler(emailWebSocketHandler, emailWebSocketRoute.getPath())
            .setAllowedOrigins("*");
}
项目:springBoot    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    // 允许连接的域,只能以http或https开头
    String[] allowsOrigins = {"http://127.0.0.1:1213", "http://localhost:1213"};
    registry.addHandler(gameHandler(),"/game").addInterceptors(handshakeInterceptor()).setAllowedOrigins(allowsOrigins);
}
项目:slider    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(final WebSocketHandlerRegistry registry) {
    registry.addHandler(handler, "/commands");
}
项目:spring4-understanding    文件:WebSocketIntegrationTests.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    this.handshakeHandler.setSupportedProtocols("foo", "bar", "baz");
    registry.addHandler(handler(), "/ws").setHandshakeHandler(this.handshakeHandler);
}
项目:spring4-understanding    文件:AbstractSockJsIntegrationTests.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    HandshakeHandler handshakeHandler = new DefaultHandshakeHandler(this.upgradeStrategy);
    registry.addHandler(new EchoHandler(), "/echo").setHandshakeHandler(handshakeHandler).withSockJS();
    registry.addHandler(testServerHandler(), "/test").setHandshakeHandler(handshakeHandler).withSockJS();
}
项目:GameNation    文件:WebSocketConfig.java   
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(chatHandler, "/chat");
}