Comments (8)
@repbl444 can you share a simple test cas on Github?
from atmosphere.
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.
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.
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
and this request
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.
@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.
Got it, thank you
from atmosphere.
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.
@repbl444 Just write an AtmosphereInterceptor and check when the transport is websocket, compress it using an open source library.
from atmosphere.
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
Maybe it is a bug or maybe I missed something. Could you give your opinion about that please?
from atmosphere.
Related Issues (20)
- Jetty 9 deflate extension and potential memory leak HOT 4
- WebSocket Handshake Fails with embedded Jetty 10 in equinox OSGi environment HOT 6
- Move class JavaScriptProtocol into package cpr HOT 4
- Websocket protocol not supported (CLS=o.a.cpr.AsynchronousProcessor) is raised in Atmosphere logs while using Jetty 10.0.9 HOT 29
- Jetty 9.4+/10 is throwing and exception when javax.session.Session.addMessageHandler(MessageHandler handler) is called HOT 1
- Potential Refactoring Estimate HOT 1
- SSE doesn't output error bodies, just spaces
- Compress JSON messages with atmosphere
- Provide runtime hints for Spring Boot 3 native applications HOT 1
- Support atmosphere-spring for Jakarta 3.0 jakarta.servlet HOT 8
- Broadcasters with names that contain both { and } are never cleaned up HOT 1
- Websocket trying to reconnect every 30 seconds HOT 1
- AtmosphereResource getting removed from resources list permanently while using Transport.SSE. HOT 3
- Websocket Closing Connection Again and Again HOT 1
- HTTP/3 WebTransport API
- JDK17 breaks working Atmosphere HOT 1
- Long-polling requests show XML parsing syntax error in Firefox console HOT 1
- "org.atmosphere.container.Jetty9AsyncSupportWithWebSocket" does not exist HOT 1
- Is there any security concerns because of query string in request URI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atmosphere.