Enable the extension with reference to both a server and client example as follow: PerMessageDeflateExample
WebSocket Per-Message Compression Extension
Extension Negotiation
1.1 DeflateClient:
private static final Draft perMessageDeflateDraft = new Draft_6455(new PerMessageDeflateExtension()); private static class DeflateClient extends WebSocketClient { public DeflateClient() throws URISyntaxException { super(new URI("ws://localhost:" + PORT), perMessageDeflateDraft); }
1.2 DefalteServer:
private static class DeflateServer extends WebSocketServer { public DeflateServer() { super(new InetSocketAddress(PORT), Collections.singletonList(perMessageDeflateDraft)); }
There was an error while loading. Please reload this page.