File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/main/java/io/github/sac Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ public class Socket extends Emitter {
3535 private Map <String , String > headers ;
3636 private SocketClusterCodec codec ;
3737 private int connectionTimeout = 5000 ;
38+ private boolean perMessageDeflate ;
3839
3940 private static final ObjectMapper mapper = new ObjectMapper ();
4041
@@ -94,6 +95,10 @@ public void setConnectionTimeout(int timeout) {
9495 connectionTimeout = timeout ;
9596 }
9697
98+ public void setPerMessageDeflateCompression (boolean enable ) {
99+ perMessageDeflate = enable ;
100+ }
101+
97102 /**
98103 * used to set up TLS/SSL connection to server for more details visit neovisionaries websocket client
99104 */
@@ -423,7 +428,12 @@ private void setupConnection() {
423428 } catch (IOException e ) {
424429 e .printStackTrace ();
425430 }
426- ws .addExtension ("permessage-deflate; client_max_window_bits" );
431+
432+ if (perMessageDeflate ) {
433+ ws .addExtension (WebSocketExtension .PERMESSAGE_DEFLATE );
434+ }
435+ ws .addExtension ("client_max_window_bits" );
436+
427437 for (Map .Entry <String , String > entry : headers .entrySet ()) {
428438 ws .addHeader (entry .getKey (), entry .getValue ());
429439 }
You can’t perform that action at this time.
0 commit comments