Giter VIP home page Giter VIP logo

Comments (8)

jfarcand avatar jfarcand commented on May 28, 2024

@repbl444 can you share a simple test cas on Github?

from atmosphere.

repbl444 avatar repbl444 commented on May 28, 2024

I am a newby in atmosphere so maybe I do not understand something. I thought that atmosphere has something to compress messages through websocket , I just should put a flag (true) . By this flag I mean to activate for example some extensions. And JSR356 looked like the one. For me it is necessary to run it on glassfish5(payara5) and I did there some configuration like
<protocols> <protocol name="http-listener-1"> <http comet-support-enabled="true" compressable-mime-type="application/javascript,application/json" compression-min-size-bytes="1024" max-connections="250" default-virtual-server="server" compression="on"> <file-cache></file-cache> </http> <ssl></ssl> </protocol> <protocol name="http-listener-2" security-enabled="true"> <http comet-support-enabled="true" compressable-mime-type="application/javascript,application/json" compression-min-size-bytes="1024" max-connections="250" default-virtual-server="server" compression="on"> <file-cache></file-cache> </http> <ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="s1as"></ssl> </protocol> <protocol name="admin-listener"> <http encoded-slash-enabled="true" max-connections="250" default-virtual-server="__asadmin"> <file-cache></file-cache> </http> </protocol> </protocols>
maybe just for streaming transport I thought it should work okay
https://github.com/repbl444/atmosphere-samples/tree/master/samples/meteor-chat
I did a commit in the fork. There I have some changes in web.xml
I just didn't find an article how to activate compression with atmosphere websockets/streaming.
Maybe I did something wrong and I need some advice, thank you in advance

from atmosphere.

repbl444 avatar repbl444 commented on May 28, 2024

I also add a gzip compression to the application with Spring MVC https://github.com/repbl444/SpringMVCtestCompression
compressable-mime-type="application/javascript,application/json" compression-min-size-bytes="1024" compression="on"
in payara5 in domain.xml like I did for the meteor-chat. After enabling gzip compression I can find some info, that it works
and see that the size of the messages is really decreased.
image
As I understand right for websocket we also can use headers like Content-Encoding or Sec-Websocket-Extensions
with the value permessage-deflate or gzip. But I did get how to turn them on.
But for now I have this Response from the server side
image
and this request
image
Could you give me an advice please?
Can I turn on a compression for websocket messages with just payara5 configuration or something with atmosphere or maybe both?

from atmosphere.

jfarcand avatar jfarcand commented on May 28, 2024

@repbl444 Salut. I don't have time right now to take a look, but I suspect you need to use Nettosphere if you want to use compression with Atmosphere. I haven't implemented the support for other server. Sorry! I will be happy to integrate your work if you take the Atmosphere code and implement it.

from atmosphere.

repbl444 avatar repbl444 commented on May 28, 2024

Got it, thank you

from atmosphere.

repbl444 avatar repbl444 commented on May 28, 2024

Can you give me some hints please which classes/configurations needs to be changed in atmosphere to support compression with glassfish? Thanks in advance.

from atmosphere.

jfarcand avatar jfarcand commented on May 28, 2024

@repbl444 Just write an AtmosphereInterceptor and check when the transport is websocket, compress it using an open source library.

from atmosphere.

repbl444 avatar repbl444 commented on May 28, 2024

Hello, thank you for hints. Now I use atmosphere http streaming instead of websocket with a gzip compression. It needs only a configuration in a server.
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" compression="on" compressionMinSize="1024" compressableMimeType="text/html,text/plain,text/css,application/javascript,application/json" />
This is only thing I need to add for tomcat9 to have a compressed messages from a scheduler I have in my example
https://github.com/repbl444/spring-atmosphere-chat-example. But I need to run it in payara5/glassfish5. It works correctly in payara only when without compression. When in domain.xml I turn the compression on, the streaming connection can not be created.
<protocol name="http-listener-1"> <http comet-support-enabled="true" compressable-mime-type="text/html,text/plain,text/css,application/javascript,application/json" compression-min-size-bytes="128" max-connections="250" default-virtual-server="server"> <file-cache></file-cache> </http> <ssl></ssl> </protocol>
Configuration for domain.xml

Glassfish says that it supports the compression when the version of http/1.1 and I have the same
image

Maybe it is a bug or maybe I missed something. Could you give your opinion about that please?

from atmosphere.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.