-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android & Node.js Server] Problem using PerMessageDeflateExtension with custom ping/pong messages ? #1164
Comments
Hey I may have to recheck the specification but I thought it is only compressed or uncompressed. Mixing not allowed. Best regards, EDIT: I have to be corrected. |
Node.js Server added below code for supporting permessage-deflate. const primus = new Primus(createHttpServer(...), {
transformer: 'websockets',
compression: true,
...
In android, there is a WebSocketClient like below, internal class WebSocketManager(private val wssUrl: URI) {
companion object {
...
// For receiving compressed data from the server
private val perMessageDeflateDraft = Draft_6455(PerMessageDeflateExtension())
}
private inner class Client : WebSocketClient {
constructor(wssUrl: URI) : super(wssUrl)
constructor(wssUrl: URI, perMessageDeflateDraft: Draft_6455) : super(
wssUrl,
perMessageDeflateDraft
)
...
// overrided functions from WebSocketClient ...
} And when calling WebSocketManager.connect(), the client object is initialized like this fun connect(): Boolean {
...
client = Client(wssUrl, perMessageDeflateDraft).apply {
connectionLostTimeout = DEFAULT_CONNECTION_CHECK_INTERVAL
addHeader(USER_AGENT_HEADER_NAME, getUserAgentString())
}
client!!.connect()
...
} For the android part, I basically followed this library's wiki on PerMessageDeflateExtension. |
@marci4 Hi, is 1.5.3 scheduled for release in the near future? |
FYI: you don't have to wait for new releases, you can always use https://oss.sonatype.org/content/repositories/snapshots/org/java-websocket/Java-WebSocket/1.5.3-SNAPSHOT/ or Jitpack (https://jitpack.io/#TooTallNate/Java-WebSocket/master-SNAPSHOT) |
Thank you for the answer! Best Regards, Sara. |
Hi, I have a question about using
PerMessageDeflateExtension
.I ran into above error log, so I made a break point like below.
If you see the log, the payload contains our custom ping message which is being transferred in TextFrame. I would like to know if this kind of custom ping/pong message could interfere with using PerMessageDeflateExtensions properly. (I checked the RFC 6455 document and read that Ping/Pong Frames have different opcodes)
Also, I couldn't understand the purpose of the below lines.
Does this mean that all TextFrame & BinaryFrame data should have isRSV1() set to true ? If so, how does it handle situations when server compresses data selectively?
Best Regards,
Sara.
The text was updated successfully, but these errors were encountered: