Tomcat JSR356 Websocket - disable permessage-deflate compression

北城余情 提交于 2019-11-28 08:41:10

问题


I'm, working on a Java servlet which runs on a Tomcat 8.0.18 server and uses the JSR356 websocket API to communicate with a browser. By default Tomcat uses the "permessage-deflate" compression to compress the websocket messages in both directions. I want to use no websocket compression, how can it be turned off? I have tried to use the compression="off" option in the file server.xml but that didn't change anything. How can i turn it off?


回答1:


Please try to add jvm option

-Dorg.apache.tomcat.websocket.DISABLE_BUILTIN_EXTENSIONS=true

to catalina.bat (for windows) or catalina.sh (for unix like OS).

e.g. add this line at the beginning of catalina.sh

CATALINA_OPTS="-Dorg.apache.tomcat.websocket.DISABLE_BUILTIN_EXTENSIONS=true"

add this line at the beginning of catalina.bat

set CATALINA_OPTS="-Dorg.apache.tomcat.websocket.DISABLE_BUILTIN_EXTENSIONS=true"


来源:https://stackoverflow.com/questions/28894316/tomcat-jsr356-websocket-disable-permessage-deflate-compression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!