Issue #5044 - rename the ClientUpgradeRequest to CoreClientUpgradeRequest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
414a0f35f9
commit
9027e17095
|
@ -61,11 +61,11 @@ import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public abstract class ClientUpgradeRequest extends HttpRequest implements Response.CompleteListener, HttpUpgrader.Factory
|
public abstract class CoreClientUpgradeRequest extends HttpRequest implements Response.CompleteListener, HttpUpgrader.Factory
|
||||||
{
|
{
|
||||||
public static ClientUpgradeRequest from(WebSocketCoreClient webSocketClient, URI requestURI, FrameHandler frameHandler)
|
public static CoreClientUpgradeRequest from(WebSocketCoreClient webSocketClient, URI requestURI, FrameHandler frameHandler)
|
||||||
{
|
{
|
||||||
return new ClientUpgradeRequest(webSocketClient, requestURI)
|
return new CoreClientUpgradeRequest(webSocketClient, requestURI)
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public FrameHandler getFrameHandler()
|
public FrameHandler getFrameHandler()
|
||||||
|
@ -75,7 +75,7 @@ public abstract class ClientUpgradeRequest extends HttpRequest implements Respon
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(ClientUpgradeRequest.class);
|
private static final Logger LOG = LoggerFactory.getLogger(CoreClientUpgradeRequest.class);
|
||||||
protected final CompletableFuture<CoreSession> futureCoreSession;
|
protected final CompletableFuture<CoreSession> futureCoreSession;
|
||||||
private final WebSocketCoreClient wsClient;
|
private final WebSocketCoreClient wsClient;
|
||||||
private FrameHandler frameHandler;
|
private FrameHandler frameHandler;
|
||||||
|
@ -83,7 +83,7 @@ public abstract class ClientUpgradeRequest extends HttpRequest implements Respon
|
||||||
private final List<UpgradeListener> upgradeListeners = new ArrayList<>();
|
private final List<UpgradeListener> upgradeListeners = new ArrayList<>();
|
||||||
private List<ExtensionConfig> requestedExtensions = new ArrayList<>();
|
private List<ExtensionConfig> requestedExtensions = new ArrayList<>();
|
||||||
|
|
||||||
public ClientUpgradeRequest(WebSocketCoreClient webSocketClient, URI requestURI)
|
public CoreClientUpgradeRequest(WebSocketCoreClient webSocketClient, URI requestURI)
|
||||||
{
|
{
|
||||||
super(webSocketClient.getHttpClient(), new HttpConversation(), requestURI);
|
super(webSocketClient.getHttpClient(), new HttpConversation(), requestURI);
|
||||||
|
|
|
@ -43,9 +43,9 @@ public class HttpUpgraderOverHTTP implements HttpUpgrader
|
||||||
private static final PreEncodedHttpField WS_CONNECTION_FIELD = new PreEncodedHttpField(HttpHeader.CONNECTION, "Upgrade");
|
private static final PreEncodedHttpField WS_CONNECTION_FIELD = new PreEncodedHttpField(HttpHeader.CONNECTION, "Upgrade");
|
||||||
private static final PreEncodedHttpField PRAGMA_NO_CACHE_FIELD = new PreEncodedHttpField(HttpHeader.PRAGMA, "no-cache");
|
private static final PreEncodedHttpField PRAGMA_NO_CACHE_FIELD = new PreEncodedHttpField(HttpHeader.PRAGMA, "no-cache");
|
||||||
private static final PreEncodedHttpField CACHE_CONTROL_NO_CACHE_FIELD = new PreEncodedHttpField(HttpHeader.CACHE_CONTROL, "no-cache");
|
private static final PreEncodedHttpField CACHE_CONTROL_NO_CACHE_FIELD = new PreEncodedHttpField(HttpHeader.CACHE_CONTROL, "no-cache");
|
||||||
private final ClientUpgradeRequest clientUpgradeRequest;
|
private final CoreClientUpgradeRequest clientUpgradeRequest;
|
||||||
|
|
||||||
public HttpUpgraderOverHTTP(ClientUpgradeRequest clientUpgradeRequest)
|
public HttpUpgraderOverHTTP(CoreClientUpgradeRequest clientUpgradeRequest)
|
||||||
{
|
{
|
||||||
this.clientUpgradeRequest = clientUpgradeRequest;
|
this.clientUpgradeRequest = clientUpgradeRequest;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,9 @@ import org.eclipse.jetty.websocket.core.WebSocketConstants;
|
||||||
public class HttpUpgraderOverHTTP2 implements HttpUpgrader
|
public class HttpUpgraderOverHTTP2 implements HttpUpgrader
|
||||||
{
|
{
|
||||||
private static final PreEncodedHttpField WS_VERSION_FIELD = new PreEncodedHttpField(HttpHeader.SEC_WEBSOCKET_VERSION, WebSocketConstants.SPEC_VERSION_STRING);
|
private static final PreEncodedHttpField WS_VERSION_FIELD = new PreEncodedHttpField(HttpHeader.SEC_WEBSOCKET_VERSION, WebSocketConstants.SPEC_VERSION_STRING);
|
||||||
private final ClientUpgradeRequest clientUpgradeRequest;
|
private final CoreClientUpgradeRequest clientUpgradeRequest;
|
||||||
|
|
||||||
public HttpUpgraderOverHTTP2(ClientUpgradeRequest clientUpgradeRequest)
|
public HttpUpgraderOverHTTP2(CoreClientUpgradeRequest clientUpgradeRequest)
|
||||||
{
|
{
|
||||||
this.clientUpgradeRequest = clientUpgradeRequest;
|
this.clientUpgradeRequest = clientUpgradeRequest;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,11 +71,11 @@ public class WebSocketCoreClient extends ContainerLifeCycle
|
||||||
|
|
||||||
public CompletableFuture<CoreSession> connect(FrameHandler frameHandler, URI wsUri) throws IOException
|
public CompletableFuture<CoreSession> connect(FrameHandler frameHandler, URI wsUri) throws IOException
|
||||||
{
|
{
|
||||||
ClientUpgradeRequest request = ClientUpgradeRequest.from(this, wsUri, frameHandler);
|
CoreClientUpgradeRequest request = CoreClientUpgradeRequest.from(this, wsUri, frameHandler);
|
||||||
return connect(request);
|
return connect(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompletableFuture<CoreSession> connect(ClientUpgradeRequest request) throws IOException
|
public CompletableFuture<CoreSession> connect(CoreClientUpgradeRequest request) throws IOException
|
||||||
{
|
{
|
||||||
if (!isStarted())
|
if (!isStarted())
|
||||||
throw new IllegalStateException(WebSocketCoreClient.class.getSimpleName() + "@" + this.hashCode() + " is not started");
|
throw new IllegalStateException(WebSocketCoreClient.class.getSimpleName() + "@" + this.hashCode() + " is not started");
|
||||||
|
|
|
@ -29,7 +29,7 @@ import java.util.zip.Deflater;
|
||||||
|
|
||||||
import org.eclipse.jetty.util.BufferUtil;
|
import org.eclipse.jetty.util.BufferUtil;
|
||||||
import org.eclipse.jetty.util.Callback;
|
import org.eclipse.jetty.util.Callback;
|
||||||
import org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest;
|
import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest;
|
||||||
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -165,7 +165,7 @@ public class AutoFragmentTest
|
||||||
public void testIncomingAutoFragmentWithPermessageDeflate() throws Exception
|
public void testIncomingAutoFragmentWithPermessageDeflate() throws Exception
|
||||||
{
|
{
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, serverUri, clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, serverUri, clientHandler);
|
||||||
upgradeRequest.addExtensions("permessage-deflate");
|
upgradeRequest.addExtensions("permessage-deflate");
|
||||||
CompletableFuture<CoreSession> connect = client.connect(upgradeRequest);
|
CompletableFuture<CoreSession> connect = client.connect(upgradeRequest);
|
||||||
connect.get(5, TimeUnit.SECONDS);
|
connect.get(5, TimeUnit.SECONDS);
|
||||||
|
@ -218,7 +218,7 @@ public class AutoFragmentTest
|
||||||
public void testGzipBomb() throws Exception
|
public void testGzipBomb() throws Exception
|
||||||
{
|
{
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, serverUri, clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, serverUri, clientHandler);
|
||||||
upgradeRequest.addExtensions("permessage-deflate");
|
upgradeRequest.addExtensions("permessage-deflate");
|
||||||
CompletableFuture<CoreSession> connect = client.connect(upgradeRequest);
|
CompletableFuture<CoreSession> connect = client.connect(upgradeRequest);
|
||||||
connect.get(5, TimeUnit.SECONDS);
|
connect.get(5, TimeUnit.SECONDS);
|
||||||
|
@ -281,7 +281,7 @@ public class AutoFragmentTest
|
||||||
|
|
||||||
// Connect to server with permessage-deflate enabled.
|
// Connect to server with permessage-deflate enabled.
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, serverUri, clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, serverUri, clientHandler);
|
||||||
upgradeRequest.addExtensions("permessage-deflate");
|
upgradeRequest.addExtensions("permessage-deflate");
|
||||||
CompletableFuture<CoreSession> connect = client.connect(upgradeRequest);
|
CompletableFuture<CoreSession> connect = client.connect(upgradeRequest);
|
||||||
connect.get(5, TimeUnit.SECONDS);
|
connect.get(5, TimeUnit.SECONDS);
|
||||||
|
|
|
@ -37,7 +37,7 @@ import org.eclipse.jetty.logging.StacklessLogging;
|
||||||
import org.eclipse.jetty.server.HttpChannel;
|
import org.eclipse.jetty.server.HttpChannel;
|
||||||
import org.eclipse.jetty.util.Callback;
|
import org.eclipse.jetty.util.Callback;
|
||||||
import org.eclipse.jetty.util.StringUtil;
|
import org.eclipse.jetty.util.StringUtil;
|
||||||
import org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest;
|
import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest;
|
||||||
import org.eclipse.jetty.websocket.core.client.UpgradeListener;
|
import org.eclipse.jetty.websocket.core.client.UpgradeListener;
|
||||||
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
||||||
import org.eclipse.jetty.websocket.core.exception.UpgradeException;
|
import org.eclipse.jetty.websocket.core.exception.UpgradeException;
|
||||||
|
@ -146,7 +146,7 @@ public class WebSocketNegotiationTest extends WebSocketTester
|
||||||
{
|
{
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
|
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
||||||
upgradeRequest.setSubProtocols("testExtensionSelection");
|
upgradeRequest.setSubProtocols("testExtensionSelection");
|
||||||
upgradeRequest.addExtensions("permessage-deflate;server_no_context_takeover", "permessage-deflate;client_no_context_takeover");
|
upgradeRequest.addExtensions("permessage-deflate;server_no_context_takeover", "permessage-deflate;client_no_context_takeover");
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ public class WebSocketNegotiationTest extends WebSocketTester
|
||||||
{
|
{
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
|
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
||||||
upgradeRequest.setSubProtocols("testNotOfferedParameter");
|
upgradeRequest.setSubProtocols("testNotOfferedParameter");
|
||||||
upgradeRequest.addExtensions("permessage-deflate;client_no_context_takeover");
|
upgradeRequest.addExtensions("permessage-deflate;client_no_context_takeover");
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ public class WebSocketNegotiationTest extends WebSocketTester
|
||||||
{
|
{
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
|
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
||||||
upgradeRequest.setSubProtocols("testInvalidExtensionParameter");
|
upgradeRequest.setSubProtocols("testInvalidExtensionParameter");
|
||||||
upgradeRequest.addExtensions("permessage-deflate;invalid_parameter");
|
upgradeRequest.addExtensions("permessage-deflate;invalid_parameter");
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ public class WebSocketNegotiationTest extends WebSocketTester
|
||||||
{
|
{
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
|
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
||||||
upgradeRequest.setSubProtocols("testNotAcceptingExtensions");
|
upgradeRequest.setSubProtocols("testNotAcceptingExtensions");
|
||||||
upgradeRequest.addExtensions("permessage-deflate;server_no_context_takeover", "permessage-deflate;client_no_context_takeover");
|
upgradeRequest.addExtensions("permessage-deflate;server_no_context_takeover", "permessage-deflate;client_no_context_takeover");
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ public class WebSocketNegotiationTest extends WebSocketTester
|
||||||
{
|
{
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
|
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
||||||
upgradeRequest.setSubProtocols("testAcceptTwoExtensionsOfSameName");
|
upgradeRequest.setSubProtocols("testAcceptTwoExtensionsOfSameName");
|
||||||
upgradeRequest.addExtensions("permessage-deflate;server_no_context_takeover", "permessage-deflate;client_no_context_takeover");
|
upgradeRequest.addExtensions("permessage-deflate;server_no_context_takeover", "permessage-deflate;client_no_context_takeover");
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ public class WebSocketNegotiationTest extends WebSocketTester
|
||||||
{
|
{
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
|
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
||||||
|
|
||||||
try (StacklessLogging stacklessLogging = new StacklessLogging(HttpChannel.class))
|
try (StacklessLogging stacklessLogging = new StacklessLogging(HttpChannel.class))
|
||||||
{
|
{
|
||||||
|
@ -317,7 +317,7 @@ public class WebSocketNegotiationTest extends WebSocketTester
|
||||||
public void testNoSubProtocolSelected() throws Exception
|
public void testNoSubProtocolSelected() throws Exception
|
||||||
{
|
{
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
||||||
upgradeRequest.setSubProtocols("testNoSubProtocolSelected");
|
upgradeRequest.setSubProtocols("testNoSubProtocolSelected");
|
||||||
CompletableFuture<HttpFields> headers = new CompletableFuture<>();
|
CompletableFuture<HttpFields> headers = new CompletableFuture<>();
|
||||||
upgradeRequest.addListener(new UpgradeListener()
|
upgradeRequest.addListener(new UpgradeListener()
|
||||||
|
@ -378,7 +378,7 @@ public class WebSocketNegotiationTest extends WebSocketTester
|
||||||
{
|
{
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
|
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
||||||
upgradeRequest.setSubProtocols("test");
|
upgradeRequest.setSubProtocols("test");
|
||||||
|
|
||||||
CompletableFuture<String> extensionHeader = new CompletableFuture<>();
|
CompletableFuture<String> extensionHeader = new CompletableFuture<>();
|
||||||
|
@ -409,7 +409,7 @@ public class WebSocketNegotiationTest extends WebSocketTester
|
||||||
public void testListenerExtensionSelectionError() throws Exception
|
public void testListenerExtensionSelectionError() throws Exception
|
||||||
{
|
{
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
||||||
upgradeRequest.setSubProtocols("test");
|
upgradeRequest.setSubProtocols("test");
|
||||||
upgradeRequest.addExtensions("permessage-deflate;server_no_context_takeover");
|
upgradeRequest.addExtensions("permessage-deflate;server_no_context_takeover");
|
||||||
|
|
||||||
|
@ -467,7 +467,7 @@ public class WebSocketNegotiationTest extends WebSocketTester
|
||||||
|
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
CompletableFuture<String> extensionHeader = new CompletableFuture<>();
|
CompletableFuture<String> extensionHeader = new CompletableFuture<>();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, server.getUri(), clientHandler);
|
||||||
upgradeRequest.setSubProtocols("test");
|
upgradeRequest.setSubProtocols("test");
|
||||||
if (!StringUtil.isEmpty(reqExts))
|
if (!StringUtil.isEmpty(reqExts))
|
||||||
upgradeRequest.addExtensions(reqExts.split(","));
|
upgradeRequest.addExtensions(reqExts.split(","));
|
||||||
|
|
|
@ -29,7 +29,7 @@ import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.eclipse.jetty.util.Callback;
|
import org.eclipse.jetty.util.Callback;
|
||||||
import org.eclipse.jetty.websocket.core.MessageHandler;
|
import org.eclipse.jetty.websocket.core.MessageHandler;
|
||||||
import org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest;
|
import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest;
|
||||||
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -51,7 +51,7 @@ public class ChatWebSocketClient
|
||||||
|
|
||||||
URI wsUri = baseWebsocketUri.resolve("/chat");
|
URI wsUri = baseWebsocketUri.resolve("/chat");
|
||||||
handler = MessageHandler.from(this::onText, null);
|
handler = MessageHandler.from(this::onText, null);
|
||||||
ClientUpgradeRequest request = ClientUpgradeRequest.from(client, wsUri, handler);
|
CoreClientUpgradeRequest request = CoreClientUpgradeRequest.from(client, wsUri, handler);
|
||||||
request.setSubProtocols("chat");
|
request.setSubProtocols("chat");
|
||||||
client.connect(request).get(5, TimeUnit.SECONDS);
|
client.connect(request).get(5, TimeUnit.SECONDS);
|
||||||
handler.sendText("[" + name + ": has joined the room]", Callback.NOOP, false);
|
handler.sendText("[" + name + ": has joined the room]", Callback.NOOP, false);
|
||||||
|
|
|
@ -34,7 +34,7 @@ import org.eclipse.jetty.websocket.core.Frame;
|
||||||
import org.eclipse.jetty.websocket.core.FrameHandler;
|
import org.eclipse.jetty.websocket.core.FrameHandler;
|
||||||
import org.eclipse.jetty.websocket.core.TestFrameHandler;
|
import org.eclipse.jetty.websocket.core.TestFrameHandler;
|
||||||
import org.eclipse.jetty.websocket.core.WebSocketServer;
|
import org.eclipse.jetty.websocket.core.WebSocketServer;
|
||||||
import org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest;
|
import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest;
|
||||||
import org.eclipse.jetty.websocket.core.client.UpgradeListener;
|
import org.eclipse.jetty.websocket.core.client.UpgradeListener;
|
||||||
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
||||||
import org.eclipse.jetty.websocket.core.server.Negotiation;
|
import org.eclipse.jetty.websocket.core.server.Negotiation;
|
||||||
|
@ -103,7 +103,7 @@ public class PerMessageDeflaterBufferSizeTest
|
||||||
{
|
{
|
||||||
int deflateBufferSize = 6;
|
int deflateBufferSize = 6;
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, serverUri, clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, serverUri, clientHandler);
|
||||||
upgradeRequest.addExtensions("permessage-deflate; @deflate_buffer_size=" + deflateBufferSize);
|
upgradeRequest.addExtensions("permessage-deflate; @deflate_buffer_size=" + deflateBufferSize);
|
||||||
|
|
||||||
CompletableFuture<HttpFields> futureRequestHeaders = new CompletableFuture<>();
|
CompletableFuture<HttpFields> futureRequestHeaders = new CompletableFuture<>();
|
||||||
|
@ -157,7 +157,7 @@ public class PerMessageDeflaterBufferSizeTest
|
||||||
{
|
{
|
||||||
int inflateBufferSize = 6;
|
int inflateBufferSize = 6;
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, serverUri, clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, serverUri, clientHandler);
|
||||||
upgradeRequest.addExtensions("permessage-deflate; @inflate_buffer_size=" + inflateBufferSize);
|
upgradeRequest.addExtensions("permessage-deflate; @inflate_buffer_size=" + inflateBufferSize);
|
||||||
|
|
||||||
CompletableFuture<HttpFields> futureRequestHeaders = new CompletableFuture<>();
|
CompletableFuture<HttpFields> futureRequestHeaders = new CompletableFuture<>();
|
||||||
|
@ -212,7 +212,7 @@ public class PerMessageDeflaterBufferSizeTest
|
||||||
{
|
{
|
||||||
testNegotiator.deflateBufferSize = 6;
|
testNegotiator.deflateBufferSize = 6;
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, serverUri, clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, serverUri, clientHandler);
|
||||||
upgradeRequest.addExtensions("permessage-deflate");
|
upgradeRequest.addExtensions("permessage-deflate");
|
||||||
|
|
||||||
CompletableFuture<HttpFields> futureResponseHeaders = new CompletableFuture<>();
|
CompletableFuture<HttpFields> futureResponseHeaders = new CompletableFuture<>();
|
||||||
|
@ -267,7 +267,7 @@ public class PerMessageDeflaterBufferSizeTest
|
||||||
{
|
{
|
||||||
testNegotiator.inflateBufferSize = 6;
|
testNegotiator.inflateBufferSize = 6;
|
||||||
TestFrameHandler clientHandler = new TestFrameHandler();
|
TestFrameHandler clientHandler = new TestFrameHandler();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, serverUri, clientHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, serverUri, clientHandler);
|
||||||
upgradeRequest.addExtensions("permessage-deflate");
|
upgradeRequest.addExtensions("permessage-deflate");
|
||||||
|
|
||||||
CompletableFuture<HttpFields> futureResponseHeaders = new CompletableFuture<>();
|
CompletableFuture<HttpFields> futureResponseHeaders = new CompletableFuture<>();
|
||||||
|
|
|
@ -45,7 +45,7 @@ import org.eclipse.jetty.websocket.core.EchoFrameHandler;
|
||||||
import org.eclipse.jetty.websocket.core.Frame;
|
import org.eclipse.jetty.websocket.core.Frame;
|
||||||
import org.eclipse.jetty.websocket.core.OpCode;
|
import org.eclipse.jetty.websocket.core.OpCode;
|
||||||
import org.eclipse.jetty.websocket.core.TestAsyncFrameHandler;
|
import org.eclipse.jetty.websocket.core.TestAsyncFrameHandler;
|
||||||
import org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest;
|
import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest;
|
||||||
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
||||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||||
import org.eclipse.jetty.websocket.core.server.WebSocketNegotiator;
|
import org.eclipse.jetty.websocket.core.server.WebSocketNegotiator;
|
||||||
|
@ -161,7 +161,7 @@ public class WebSocketProxyTest
|
||||||
WebSocketProxy.Client2Proxy proxyClientSide = proxy.client2Proxy;
|
WebSocketProxy.Client2Proxy proxyClientSide = proxy.client2Proxy;
|
||||||
WebSocketProxy.Server2Proxy proxyServerSide = proxy.server2Proxy;
|
WebSocketProxy.Server2Proxy proxyServerSide = proxy.server2Proxy;
|
||||||
|
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(_client, new URI("ws://localhost:" + PROXY_PORT + "/proxy/"), clientFrameHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(_client, new URI("ws://localhost:" + PROXY_PORT + "/proxy/"), clientFrameHandler);
|
||||||
upgradeRequest.setConfiguration(defaultCustomizer);
|
upgradeRequest.setConfiguration(defaultCustomizer);
|
||||||
CompletableFuture<CoreSession> response = _client.connect(upgradeRequest);
|
CompletableFuture<CoreSession> response = _client.connect(upgradeRequest);
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ public class WebSocketProxyTest
|
||||||
TestAsyncFrameHandler clientFrameHandler = new TestAsyncFrameHandler("CLIENT");
|
TestAsyncFrameHandler clientFrameHandler = new TestAsyncFrameHandler("CLIENT");
|
||||||
try (StacklessLogging stacklessLogging = new StacklessLogging(WebSocketCoreSession.class))
|
try (StacklessLogging stacklessLogging = new StacklessLogging(WebSocketCoreSession.class))
|
||||||
{
|
{
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(_client, new URI("ws://localhost:" + PROXY_PORT + "/proxy/"), clientFrameHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(_client, new URI("ws://localhost:" + PROXY_PORT + "/proxy/"), clientFrameHandler);
|
||||||
upgradeRequest.setConfiguration(defaultCustomizer);
|
upgradeRequest.setConfiguration(defaultCustomizer);
|
||||||
CompletableFuture<CoreSession> response = _client.connect(upgradeRequest);
|
CompletableFuture<CoreSession> response = _client.connect(upgradeRequest);
|
||||||
response.get(5, TimeUnit.SECONDS);
|
response.get(5, TimeUnit.SECONDS);
|
||||||
|
@ -240,7 +240,7 @@ public class WebSocketProxyTest
|
||||||
|
|
||||||
try (StacklessLogging stacklessLogging = new StacklessLogging(WebSocketCoreSession.class))
|
try (StacklessLogging stacklessLogging = new StacklessLogging(WebSocketCoreSession.class))
|
||||||
{
|
{
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(_client, new URI("ws://localhost:" + PROXY_PORT + "/proxy/"), clientFrameHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(_client, new URI("ws://localhost:" + PROXY_PORT + "/proxy/"), clientFrameHandler);
|
||||||
upgradeRequest.setConfiguration(defaultCustomizer);
|
upgradeRequest.setConfiguration(defaultCustomizer);
|
||||||
CompletableFuture<CoreSession> response = _client.connect(upgradeRequest);
|
CompletableFuture<CoreSession> response = _client.connect(upgradeRequest);
|
||||||
Exception e = assertThrows(ExecutionException.class, () -> response.get(5, TimeUnit.SECONDS));
|
Exception e = assertThrows(ExecutionException.class, () -> response.get(5, TimeUnit.SECONDS));
|
||||||
|
@ -271,7 +271,7 @@ public class WebSocketProxyTest
|
||||||
WebSocketProxy.Server2Proxy proxyServerSide = proxy.server2Proxy;
|
WebSocketProxy.Server2Proxy proxyServerSide = proxy.server2Proxy;
|
||||||
|
|
||||||
TestAsyncFrameHandler clientFrameHandler = new TestAsyncFrameHandler("CLIENT");
|
TestAsyncFrameHandler clientFrameHandler = new TestAsyncFrameHandler("CLIENT");
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(_client, new URI("ws://localhost:" + PROXY_PORT + "/proxy/"), clientFrameHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(_client, new URI("ws://localhost:" + PROXY_PORT + "/proxy/"), clientFrameHandler);
|
||||||
upgradeRequest.setConfiguration(defaultCustomizer);
|
upgradeRequest.setConfiguration(defaultCustomizer);
|
||||||
CompletableFuture<CoreSession> response = _client.connect(upgradeRequest);
|
CompletableFuture<CoreSession> response = _client.connect(upgradeRequest);
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ public class WebSocketProxyTest
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(_client, new URI("ws://localhost:" + PROXY_PORT + "/proxy/"), clientFrameHandler);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(_client, new URI("ws://localhost:" + PROXY_PORT + "/proxy/"), clientFrameHandler);
|
||||||
upgradeRequest.setConfiguration(defaultCustomizer);
|
upgradeRequest.setConfiguration(defaultCustomizer);
|
||||||
CompletableFuture<CoreSession> response = _client.connect(upgradeRequest);
|
CompletableFuture<CoreSession> response = _client.connect(upgradeRequest);
|
||||||
response.get(5, TimeUnit.SECONDS);
|
response.get(5, TimeUnit.SECONDS);
|
||||||
|
|
|
@ -24,12 +24,12 @@ import java.security.Principal;
|
||||||
import org.eclipse.jetty.client.HttpResponse;
|
import org.eclipse.jetty.client.HttpResponse;
|
||||||
import org.eclipse.jetty.io.EndPoint;
|
import org.eclipse.jetty.io.EndPoint;
|
||||||
import org.eclipse.jetty.websocket.core.FrameHandler;
|
import org.eclipse.jetty.websocket.core.FrameHandler;
|
||||||
import org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest;
|
import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest;
|
||||||
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
||||||
import org.eclipse.jetty.websocket.javax.common.JavaxWebSocketFrameHandler;
|
import org.eclipse.jetty.websocket.javax.common.JavaxWebSocketFrameHandler;
|
||||||
import org.eclipse.jetty.websocket.javax.common.UpgradeRequest;
|
import org.eclipse.jetty.websocket.javax.common.UpgradeRequest;
|
||||||
|
|
||||||
public class JavaxClientUpgradeRequest extends ClientUpgradeRequest implements UpgradeRequest
|
public class JavaxClientUpgradeRequest extends CoreClientUpgradeRequest implements UpgradeRequest
|
||||||
{
|
{
|
||||||
private final JavaxWebSocketFrameHandler frameHandler;
|
private final JavaxWebSocketFrameHandler frameHandler;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ import org.eclipse.jetty.websocket.core.CloseStatus;
|
||||||
import org.eclipse.jetty.websocket.core.CoreSession;
|
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||||
import org.eclipse.jetty.websocket.core.Frame;
|
import org.eclipse.jetty.websocket.core.Frame;
|
||||||
import org.eclipse.jetty.websocket.core.FrameHandler;
|
import org.eclipse.jetty.websocket.core.FrameHandler;
|
||||||
import org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest;
|
import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest;
|
||||||
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
||||||
import org.eclipse.jetty.websocket.core.internal.Generator;
|
import org.eclipse.jetty.websocket.core.internal.Generator;
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ public class NetworkFuzzer extends Fuzzer.Adapter implements Fuzzer, AutoCloseab
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class RawUpgradeRequest extends ClientUpgradeRequest
|
public static class RawUpgradeRequest extends CoreClientUpgradeRequest
|
||||||
{
|
{
|
||||||
private final FrameCapture frameCapture = new FrameCapture();
|
private final FrameCapture frameCapture = new FrameCapture();
|
||||||
private final CompletableFuture<FrameCapture> futureCapture;
|
private final CompletableFuture<FrameCapture> futureCapture;
|
||||||
|
|
|
@ -54,7 +54,7 @@ import org.eclipse.jetty.util.Callback;
|
||||||
import org.eclipse.jetty.websocket.core.CoreSession;
|
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||||
import org.eclipse.jetty.websocket.core.Frame;
|
import org.eclipse.jetty.websocket.core.Frame;
|
||||||
import org.eclipse.jetty.websocket.core.OpCode;
|
import org.eclipse.jetty.websocket.core.OpCode;
|
||||||
import org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest;
|
import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest;
|
||||||
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
||||||
import org.eclipse.jetty.websocket.javax.server.internal.JavaxWebSocketCreator;
|
import org.eclipse.jetty.websocket.javax.server.internal.JavaxWebSocketCreator;
|
||||||
import org.eclipse.jetty.websocket.javax.tests.LocalServer;
|
import org.eclipse.jetty.websocket.javax.tests.LocalServer;
|
||||||
|
@ -430,7 +430,7 @@ public class ConfiguratorTest
|
||||||
URI wsUri = server.getWsUri().resolve("/capture-request-headers");
|
URI wsUri = server.getWsUri().resolve("/capture-request-headers");
|
||||||
|
|
||||||
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, wsUri, clientSocket);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, wsUri, clientSocket);
|
||||||
upgradeRequest.addExtensions("identity");
|
upgradeRequest.addExtensions("identity");
|
||||||
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
||||||
|
|
||||||
|
@ -454,7 +454,7 @@ public class ConfiguratorTest
|
||||||
URI wsUri = server.getWsUri().resolve("/no-extensions");
|
URI wsUri = server.getWsUri().resolve("/no-extensions");
|
||||||
|
|
||||||
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, wsUri, clientSocket);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, wsUri, clientSocket);
|
||||||
upgradeRequest.addExtensions("identity");
|
upgradeRequest.addExtensions("identity");
|
||||||
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
||||||
|
|
||||||
|
@ -478,7 +478,7 @@ public class ConfiguratorTest
|
||||||
URI wsUri = server.getWsUri().resolve("/capture-request-headers");
|
URI wsUri = server.getWsUri().resolve("/capture-request-headers");
|
||||||
|
|
||||||
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, wsUri, clientSocket);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, wsUri, clientSocket);
|
||||||
upgradeRequest.headers(headers -> headers.put("X-Dummy", "Bogus"));
|
upgradeRequest.headers(headers -> headers.put("X-Dummy", "Bogus"));
|
||||||
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
||||||
|
|
||||||
|
@ -503,7 +503,7 @@ public class ConfiguratorTest
|
||||||
|
|
||||||
// First Request
|
// First Request
|
||||||
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, wsUri, clientSocket);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, wsUri, clientSocket);
|
||||||
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
||||||
|
|
||||||
CoreSession coreSession = clientConnectFuture.get(Timeouts.CONNECT_MS, TimeUnit.MILLISECONDS);
|
CoreSession coreSession = clientConnectFuture.get(Timeouts.CONNECT_MS, TimeUnit.MILLISECONDS);
|
||||||
|
@ -522,7 +522,7 @@ public class ConfiguratorTest
|
||||||
|
|
||||||
// Second request
|
// Second request
|
||||||
clientSocket = new FrameHandlerTracker();
|
clientSocket = new FrameHandlerTracker();
|
||||||
upgradeRequest = ClientUpgradeRequest.from(client, wsUri, clientSocket);
|
upgradeRequest = CoreClientUpgradeRequest.from(client, wsUri, clientSocket);
|
||||||
clientConnectFuture = client.connect(upgradeRequest);
|
clientConnectFuture = client.connect(upgradeRequest);
|
||||||
|
|
||||||
coreSession = clientConnectFuture.get(Timeouts.CONNECT_MS, TimeUnit.MILLISECONDS);
|
coreSession = clientConnectFuture.get(Timeouts.CONNECT_MS, TimeUnit.MILLISECONDS);
|
||||||
|
@ -550,7 +550,7 @@ public class ConfiguratorTest
|
||||||
URI wsUri = server.getWsUri().resolve("/addr");
|
URI wsUri = server.getWsUri().resolve("/addr");
|
||||||
|
|
||||||
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, wsUri, clientSocket);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, wsUri, clientSocket);
|
||||||
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
||||||
|
|
||||||
CoreSession coreSession = clientConnectFuture.get(Timeouts.CONNECT_MS, TimeUnit.MILLISECONDS);
|
CoreSession coreSession = clientConnectFuture.get(Timeouts.CONNECT_MS, TimeUnit.MILLISECONDS);
|
||||||
|
@ -591,7 +591,7 @@ public class ConfiguratorTest
|
||||||
ProtocolsConfigurator.seenProtocols.set(null);
|
ProtocolsConfigurator.seenProtocols.set(null);
|
||||||
|
|
||||||
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, wsUri, clientSocket);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, wsUri, clientSocket);
|
||||||
upgradeRequest.setSubProtocols("status");
|
upgradeRequest.setSubProtocols("status");
|
||||||
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ public class ConfiguratorTest
|
||||||
ProtocolsConfigurator.seenProtocols.set(null);
|
ProtocolsConfigurator.seenProtocols.set(null);
|
||||||
|
|
||||||
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, wsUri, clientSocket);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, wsUri, clientSocket);
|
||||||
upgradeRequest.setSubProtocols("echo", "chat", "status");
|
upgradeRequest.setSubProtocols("echo", "chat", "status");
|
||||||
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
||||||
|
|
||||||
|
@ -629,7 +629,7 @@ public class ConfiguratorTest
|
||||||
ProtocolsConfigurator.seenProtocols.set(null);
|
ProtocolsConfigurator.seenProtocols.set(null);
|
||||||
|
|
||||||
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, wsUri, clientSocket);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, wsUri, clientSocket);
|
||||||
upgradeRequest.setSubProtocols("echo", "chat", "status");
|
upgradeRequest.setSubProtocols("echo", "chat", "status");
|
||||||
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
||||||
|
|
||||||
|
@ -648,7 +648,7 @@ public class ConfiguratorTest
|
||||||
ProtocolsConfigurator.seenProtocols.set(null);
|
ProtocolsConfigurator.seenProtocols.set(null);
|
||||||
|
|
||||||
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, wsUri, clientSocket);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, wsUri, clientSocket);
|
||||||
upgradeRequest.setSubProtocols("echo", "chat", "status");
|
upgradeRequest.setSubProtocols("echo", "chat", "status");
|
||||||
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
||||||
|
|
||||||
|
@ -681,7 +681,7 @@ public class ConfiguratorTest
|
||||||
URI wsUri = server.getWsUri().resolve("/timedecoder");
|
URI wsUri = server.getWsUri().resolve("/timedecoder");
|
||||||
|
|
||||||
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
FrameHandlerTracker clientSocket = new FrameHandlerTracker();
|
||||||
ClientUpgradeRequest upgradeRequest = ClientUpgradeRequest.from(client, wsUri, clientSocket);
|
CoreClientUpgradeRequest upgradeRequest = CoreClientUpgradeRequest.from(client, wsUri, clientSocket);
|
||||||
upgradeRequest.setSubProtocols("gmt");
|
upgradeRequest.setSubProtocols("gmt");
|
||||||
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
Future<CoreSession> clientConnectFuture = client.connect(upgradeRequest);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ import org.eclipse.jetty.util.MultiMap;
|
||||||
import org.eclipse.jetty.util.UrlEncoded;
|
import org.eclipse.jetty.util.UrlEncoded;
|
||||||
import org.eclipse.jetty.websocket.api.UpgradeRequest;
|
import org.eclipse.jetty.websocket.api.UpgradeRequest;
|
||||||
import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig;
|
import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig;
|
||||||
import org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest;
|
import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest;
|
||||||
|
|
||||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
|
||||||
|
@ -44,9 +44,9 @@ import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
*/
|
*/
|
||||||
public class DelegatedJettyClientUpgradeRequest implements UpgradeRequest
|
public class DelegatedJettyClientUpgradeRequest implements UpgradeRequest
|
||||||
{
|
{
|
||||||
private final ClientUpgradeRequest delegate;
|
private final CoreClientUpgradeRequest delegate;
|
||||||
|
|
||||||
public DelegatedJettyClientUpgradeRequest(ClientUpgradeRequest delegate)
|
public DelegatedJettyClientUpgradeRequest(CoreClientUpgradeRequest delegate)
|
||||||
{
|
{
|
||||||
this.delegate = delegate;
|
this.delegate = delegate;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,10 @@ import org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler;
|
||||||
import org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandlerFactory;
|
import org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandlerFactory;
|
||||||
import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
||||||
import org.eclipse.jetty.websocket.core.FrameHandler;
|
import org.eclipse.jetty.websocket.core.FrameHandler;
|
||||||
|
import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest;
|
||||||
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
||||||
|
|
||||||
public class JettyClientUpgradeRequest extends org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest
|
public class JettyClientUpgradeRequest extends CoreClientUpgradeRequest
|
||||||
{
|
{
|
||||||
private final JettyWebSocketFrameHandler frameHandler;
|
private final JettyWebSocketFrameHandler frameHandler;
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ import org.eclipse.jetty.websocket.util.server.internal.ServletUpgradeRequest;
|
||||||
|
|
||||||
public class JettyServerUpgradeRequest
|
public class JettyServerUpgradeRequest
|
||||||
{
|
{
|
||||||
private ServletUpgradeRequest upgradeRequest;
|
private final ServletUpgradeRequest upgradeRequest;
|
||||||
|
|
||||||
JettyServerUpgradeRequest(ServletUpgradeRequest request)
|
JettyServerUpgradeRequest(ServletUpgradeRequest request)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,9 +31,7 @@ import org.eclipse.jetty.websocket.util.server.internal.FrameHandlerFactory;
|
||||||
import org.eclipse.jetty.websocket.util.server.internal.ServletUpgradeRequest;
|
import org.eclipse.jetty.websocket.util.server.internal.ServletUpgradeRequest;
|
||||||
import org.eclipse.jetty.websocket.util.server.internal.ServletUpgradeResponse;
|
import org.eclipse.jetty.websocket.util.server.internal.ServletUpgradeResponse;
|
||||||
|
|
||||||
public class JettyServerFrameHandlerFactory
|
public class JettyServerFrameHandlerFactory extends JettyWebSocketFrameHandlerFactory implements FrameHandlerFactory, LifeCycle.Listener
|
||||||
extends JettyWebSocketFrameHandlerFactory
|
|
||||||
implements FrameHandlerFactory, LifeCycle.Listener
|
|
||||||
{
|
{
|
||||||
public static JettyServerFrameHandlerFactory getFactory(ServletContext context)
|
public static JettyServerFrameHandlerFactory getFactory(ServletContext context)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue