PerMessageDeflateExample - TooTallNate/Java-WebSocket GitHub Wiki
Introduction
Enable the extension with reference to both a server and client example as follow: PerMessageDeflateExample
How does it work
WebSocket Per-Message Compression Extension
Example
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));
}