Reactor Netty WebSocket server-side support
Issue: SPR-14527
This commit is contained in:
@@ -27,11 +27,13 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.server.reactive.HttpHandler;
|
||||
import org.springframework.http.server.reactive.bootstrap.HttpServer;
|
||||
import org.springframework.http.server.reactive.bootstrap.ReactorHttpServer;
|
||||
import org.springframework.http.server.reactive.bootstrap.RxNettyHttpServer;
|
||||
import org.springframework.util.SocketUtils;
|
||||
import org.springframework.web.reactive.DispatcherHandler;
|
||||
import org.springframework.web.reactive.socket.server.support.HandshakeWebSocketService;
|
||||
import org.springframework.web.reactive.socket.server.support.WebSocketHandlerAdapter;
|
||||
import org.springframework.web.reactive.socket.server.upgrade.ReactorNettyRequestUpgradeStrategy;
|
||||
import org.springframework.web.reactive.socket.server.upgrade.RxNettyRequestUpgradeStrategy;
|
||||
|
||||
/**
|
||||
@@ -58,6 +60,7 @@ public abstract class AbstractWebSocketHandlerIntegrationTests {
|
||||
@Parameters
|
||||
public static Object[][] arguments() {
|
||||
return new Object[][] {
|
||||
{new ReactorHttpServer(), ReactorNettyConfig.class},
|
||||
{new RxNettyHttpServer(), RxNettyConfig.class}
|
||||
};
|
||||
}
|
||||
@@ -110,6 +113,15 @@ public abstract class AbstractWebSocketHandlerIntegrationTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class ReactorNettyConfig extends AbstractHandlerAdapterConfig {
|
||||
|
||||
@Override
|
||||
protected RequestUpgradeStrategy createUpgradeStrategy() {
|
||||
return new ReactorNettyRequestUpgradeStrategy();
|
||||
}
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class RxNettyConfig extends AbstractHandlerAdapterConfig {
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import org.springframework.web.reactive.socket.WebSocketSession;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* Basic WebSocket integration
|
||||
* Basic WebSocket integration tests.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
@SuppressWarnings({"unused", "WeakerAccess"})
|
||||
|
||||
Reference in New Issue
Block a user