use of io.rsocket.core.RSocketServer in project spring-boot by spring-projects.
the class RSocketWebSocketNettyRouteProvider method apply.
@Override
public HttpServerRoutes apply(HttpServerRoutes httpServerRoutes) {
RSocketServer server = RSocketServer.create(this.socketAcceptor);
this.customizers.forEach((customizer) -> customizer.customize(server));
ServerTransport.ConnectionAcceptor connectionAcceptor = server.asConnectionAcceptor();
return httpServerRoutes.ws(this.mappingPath, WebsocketRouteTransport.newHandler(connectionAcceptor));
}
use of io.rsocket.core.RSocketServer in project spring-boot by spring-projects.
the class RSocketSecurityAutoConfigurationTests method autoConfigurationAddsCustomizerForServerRSocketFactory.
@Test
void autoConfigurationAddsCustomizerForServerRSocketFactory() {
RSocketServer server = RSocketServer.create();
this.contextRunner.run((context) -> {
RSocketServerCustomizer customizer = context.getBean(RSocketServerCustomizer.class);
customizer.customize(server);
server.interceptors((registry) -> registry.forSocketAcceptor((interceptors) -> {
assertThat(interceptors).isNotEmpty();
assertThat(interceptors).anyMatch((interceptor) -> interceptor instanceof SecuritySocketAcceptorInterceptor);
}));
});
}
Aggregations