This repository has been archived by the owner on Nov 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Add keep-alive support for a more persistent connection #21
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Session restoration fix
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4. - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES) - [Commits](yaml/pyyaml@5.3.1...5.4) Signed-off-by: dependabot[bot] <[email protected]>
Bumps [websockets](https://github.com/aaugustin/websockets) from 8.1 to 9.1. - [Release notes](https://github.com/aaugustin/websockets/releases) - [Changelog](https://github.com/aaugustin/websockets/blob/9.1/docs/changelog.rst) - [Commits](python-websockets/websockets@8.1...9.1) --- updated-dependencies: - dependency-name: websockets dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [websockets](https://github.com/aaugustin/websockets) from 8.1 to 9.1. - [Release notes](https://github.com/aaugustin/websockets/releases) - [Changelog](https://github.com/aaugustin/websockets/blob/9.1/docs/changelog.rst) - [Commits](python-websockets/websockets@8.1...9.1) --- updated-dependencies: - dependency-name: websockets dependency-type: direct:development ... Signed-off-by: dependabot[bot] <[email protected]>
…ckets-9.1 Bump websockets from 8.1 to 9.1 in /kyros
Bump websockets from 8.1 to 9.1
…l-5.4 Bump pyyaml from 5.3.1 to 5.4 in /kyros
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4. - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES) - [Commits](yaml/pyyaml@5.3.1...5.4) Signed-off-by: dependabot[bot] <[email protected]>
Bump pyyaml from 5.3.1 to 5.4
* Send keep alive message every 10 seconds * Ignore server timestamp response Signed-off-by: Reinier Millo <[email protected]>
* After user scanned QR code * After session restored Signed-off-by: Reinier Millo <[email protected]>
Merge branch 'feature/prevent-websocket-close' into develop
Signed-off-by: Reinier Millo <[email protected]>
lc-at
changed the title
Develop
Add keep-alive support for a more persistent conneciton
Jan 15, 2022
lc-at
suggested changes
Jan 15, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a glance, it looks quite good to me. However, you need to make sure that your code is consistent with the whole code base (make sure it complies to PEP8).
I haven't tested the code though, but it looks promising.
@rijumone, can you test and review this? |
lc-at
changed the title
Add keep-alive support for a more persistent conneciton
Add keep-alive support for a more persistent connection
Jan 15, 2022
Closed
* Change keepAlive function name to keep_alive * Add missing space Signed-off-by: Reinier Millo <[email protected]>
Signed-off-by: Reinier Millo <[email protected]>
@p4kl0nc4t, I would love to. However, I am yet to get this library running on my dev environment owing to #19 . Would it be possible to hop on a Zoom call or something to get me up to speed on this? An overall walk-through of the library would also be greatly appreciated. |
Signed-off-by: Reinier Millo <[email protected]>
* Plain text messages area send to queue * Binary messages are send to message handler Signed-off-by: Reinier Millo <[email protected]>
* Dispatch keep alive message after conn received Signed-off-by: Reinier Millo <[email protected]>
Signed-off-by: Reinier Millo <[email protected]>
* Add callback function * TODO Identify message types to call handlers Signed-off-by: Reinier Millo <[email protected]>
* Support to save/load session in JSON file * User message handle callback to log received messages Signed-off-by: Reinier Millo <[email protected]>
* Receive text messages from WhatsApp
This was referenced Jan 30, 2022
Closed
lc-at
pushed a commit
that referenced
this pull request
Nov 2, 2023
Add keep-alive support for a more persistent connection Websocket was closing after 30 seconds. WhatsApp don't use ping/pong timeout handled by websocket protocol. This timeouts must be disabled, and send custom message every 10 seconds to keep alive the connection. WhatsApp server will respond to the custom message with a plain text message with current server timestamps.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have rebased master branch into develop, and added support to prevent websocket be closed after 30 seconds. It must solve issue #18