webpush | webpush , Encryption Utilities for Web Push protocol | Notification library

 by   zaru Ruby Version: Current License: MIT

kandi X-RAY | webpush Summary

kandi X-RAY | webpush Summary

webpush is a Ruby library typically used in Messaging, Notification applications. webpush has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

This gem makes it possible to send push messages to web browsers from Ruby backends using the Web Push Protocol. It supports Message Encryption for Web Push to send messages securely from server to user agent. Payload is supported by Chrome 50+, Firefox 48+, Edge 79+.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              webpush has a low active ecosystem.
              It has 316 star(s) with 55 fork(s). There are 13 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 3 open issues and 40 have been closed. On average issues are closed in 180 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of webpush is current.

            kandi-Quality Quality

              webpush has no bugs reported.

            kandi-Security Security

              webpush has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              webpush is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              webpush releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed webpush and discovered the below as its top functions. This is intended to give you an instant insight into webpush implemented functionality, and help decide if they suit your requirements.
            • Encrypts a message using the encrypted key and encryption key
            • The HTTP headers .
            • raise an error message
            • Make a HTTP request .
            • Generate the header header
            • Get proxy options
            • Verify that the parameters are valid
            • Builds a message from the payload
            • Returns the public key
            • Gets the severity
            Get all kandi verified functions for this library.

            webpush Key Features

            No Key Features are available at this moment for webpush.

            webpush Examples and Code Snippets

            No Code Snippets are available at this moment for webpush.

            Community Discussions

            QUESTION

            Web Push Django in Safari
            Asked 2021-May-27 at 09:34

            I am using push notifications in Django, I am using the library https://github.com/safwanrahman/django-webpush

            It work correctly in Chrome and Firefox, but in Safari I have a JS error.

            ...

            ANSWER

            Answered 2021-May-27 at 09:34

            That's because for invoking push notification in Safari or IOS devices, APNS (Apple Push Notification Service) is required and maintainers of django-web-push have not integrated them yet.

            You will need to add APNS support by yourself by adding a fallback option for IOS devices and browsers or you can use any other apns push notification service.

            Source https://stackoverflow.com/questions/65609017

            QUESTION

            Angular - Service worker : How to get dynamic ID from route into the "Notificationclick" event?
            Asked 2021-May-17 at 13:02

            I have put some push notifications in my code, in order to someone to be notified when an action is made. I made the back end with lib.net.webpush 3.1.0 with .net 4.5.2 in C#. So far, the notification system is working very well, but there is something I can't succeed : Within my service worker file (sw.js), using Angular 9, i want, when someone received the notification, that when a user click on it, he is redirect to the page from which it was sent.

            first i made it like it (as i read in the doc):

            ...

            ANSWER

            Answered 2021-May-17 at 13:02

            I just succeed in doing it. So, for anyone in the same case as I was : within the service worker, you can't access the DOM, i wasn't able to get any ID or any path I was trying to aim in my code. The solution was to, in my C# code, to add a "URL" property and parameter to my "SendNotification" funtion. Then, when i got a user, i can target his ID because it's already here. Then, in my Angular code (within the service worker file), I just had to to this (i am storing my url in "data" here) :

            Source https://stackoverflow.com/questions/67501542

            QUESTION

            How to send payload with web-push-csharp
            Asked 2021-Apr-02 at 15:03

            I'd like to make web push with c#. In the backend I use web-push-csharp. I try to test it with postman before pass the API to frontend developer but I get this error.

            "Message": "An error has occurred.", "ExceptionMessage": "The best overloaded method match for 'WebPush.WebPushClient.SendNotificationAsync(WebPush.PushSubscription, string, System.Collections.Generic.Dictionary)' has some invalid arguments", "ExceptionType": "Microsoft.CSharp.RuntimeBinder.RuntimeBinderException",

            The error comes from payload in the json body because when I replace it with a simple string , the error is gone.

            This is the json body in postman:

            ...

            ANSWER

            Answered 2021-Apr-02 at 15:03

            Solved by creating the payload like this :

            Source https://stackoverflow.com/questions/66906389

            QUESTION

            Django web-push "Reverse for 'save_webpush_info'"
            Asked 2021-Mar-03 at 17:58

            I've installed django-webpush in my project and put {% webpush_header %} in the part of my HTML template as instructed, however I am getting an error:

            ...

            ANSWER

            Answered 2021-Mar-03 at 17:58

            I assume your urls.py is something like so:

            Source https://stackoverflow.com/questions/66459119

            QUESTION

            How to generate web push vapid keys in node js?
            Asked 2020-Dec-02 at 00:06

            I installed web push :

            ...

            ANSWER

            Answered 2020-Sep-20 at 14:20

            I fixed the error by using \ instead of /

            Source https://stackoverflow.com/questions/63979872

            QUESTION

            How webpush work in TCP/IP network layers
            Asked 2020-Nov-28 at 14:34

            Please explain to me how webpush work in TCP/IP network layers (especially layer 4-5).

            I understand that HTTP is stateless protocol:

            • the protocol is opening TCP / layer 4 connection,
            • 'state' is 'made to work' with cookie/session,
            • then client send HTTP request (plaintext/compressed "HTTP/1.1 /url/here ... Content-Length: ..."),
            • then server respond with HTTP request (plaintext/compressed "200 OK ... ..."),

            Therefore it's understandable that for a user behind NAT to be able to view webpage of a remote host (because the user behind NAT is the one initiating the connection); but the webserver cannot initiate TCP connection with the client (browser process).

            However there are some exceptions like 'websocket' where client (browser) initiate a connection, then leave it open (elevate to just TCP, not HTTP anymore). In this architecture, webserver may send / initiate sending message to client (for example "you have new chat message" notification).

            What I don't understand is the new term 'webpush'.

            • I observed that it can send notification from server to client/browser (from user, it 'feels' like the server is the one initiating the connection)
            • webpush can send notification anytime, even when browser is closed / not opened yet (as when the device was just freshly turned on), or when it's just connected to internet

            How does it work? How do they accomplish this? Previously I think that:

            • either a javascript in a page is continously (ex: 5 second interval) checking if there's a new notification in server,
            • or a javascript initiate a websocket (browser initiate/open TCP connection) and keep it alive, when server need to send something, it's sent from webserver to client/browser through this connection

            Is this correct? Or am I missing something? Since both of my guess above won't work behind NAT'd network

            Is Firebase web notification also this kind of webpush?

            I have searched the internet for explanation on what make it work on client side, but there seems only explanation on 'how to send webpush', 'how to market your product with webpush', those articles only explain the server side (communication of app server with push service server) or articles about marketing.

            Also, I'm interested in understanding what application layer protocol they're running on (as in what text/binary data the client/server send to each other), if it's not HTTP

            ...

            ANSWER

            Answered 2020-Nov-28 at 14:34

            Web Push works because there is a persistent connection between the browser (e.g. Chrome) and the browser push service (e.g. FCM).

            When your application server needs to send a notification to a browser, it cannot reach the browser directly with a connection, instead it contacts the browser push service (e.g. FCM for Chrome) and then it's the browser push service that delivers the notification to the user browser.

            This is possible because the browser constantly tries to keep an open connection with the server (e.g. FCM for Chrome). This means that there isn't any problem for NAT, since it's the clients that starts the connection. Also consider that any TCP connection is bi-directional: so any side of the connection can start sending data at any time. Don't confuse higher level protocols like HTTP with a normal TCP connection.

            If you want more details I have written this article that explains in simple words how Web Push works. You can also read the standards: Push API and IETF Web Push in particular.

            Note: Firebase (FCM) is two different things, even if that is not clear from the documentation. It is both the browser push service required to deliver notifications to Chrome (like Mozilla autopush for Firefox, Windows Push Notification Services for Edge and Apple Push Notification service for Safari), but it is also a proprietary service with additional features to send notifications to any browser (like Pushpad, Onesignal and many others).

            Source https://stackoverflow.com/questions/65049310

            QUESTION

            How to save cookie on development localhost
            Asked 2020-Nov-14 at 12:24

            I have node.js with express backend with some endpoints, all works fine testing with curl or postman, but on my client-side with angular on the http.post request i get the response correctly, but no cookie is saved. I've tried changing my localhost dns, after some try i'm ended up using 127.0.0.1:4200 client and 127.0.0.1:3000 backend.

            backend code:

            ...

            ANSWER

            Answered 2020-Nov-14 at 12:24

            the BENARD Patrick tips was right!!

            To solve my problem add withCredentials both on client and server (using this solution I've had to specify the domain)

            client code:

            Source https://stackoverflow.com/questions/64832888

            QUESTION

            Why am I getting "Error: No key set vapidDetails.publicKey"?
            Asked 2020-Sep-24 at 02:47

            I'm trying to run a 'node.js' server for push notification. But I received an error instead. This was picked up on a tutorial for adding push notification using SwPush to PWA on Angular.

            Do I need to place the Public key somewhere?? I had generated public and private keys using "web-push generate-vapid-keys".

            Server.js script:

            ...

            ANSWER

            Answered 2020-Sep-24 at 02:47

            QUESTION

            Is it safe to use the "p256dh" or "endpoint" keys values of the push notification subscription object as an identifier within the back-end?
            Asked 2020-Sep-06 at 21:46

            When a user create a subscription through the PushManager.subscribe(), given the applicationServerKey (VAPID public key), it creates a valid subscription the contents of which can be sent and stored in the database. The content sent to the database looks something like the following:

            ...

            ANSWER

            Answered 2020-Sep-06 at 21:46

            You can safely use the endpoint as a unique identifier in your database and in the frontend calls to the backend.

            We have been using it in the Pushpad Javascript SDK since 2015 without any problem.

            For example, you can use the endpoint as an identifier when you make a call from Javascript to the backend in order to store data for that specific subscription.

            An endpoint can be considered unique and secret (since it contains a long random token).

            This is true now and it was also true at the beginning of the standard... in the past the keys and payload were not even present and the endpoint alone was used for everything, including fetching the new notifications from the application server.

            For the keys I would simply keep them secret in the database and not use them as identifiers.

            Source https://stackoverflow.com/questions/63767889

            QUESTION

            Sent messages to FCM topics using post request don't get delivered Flutter
            Asked 2020-Aug-25 at 15:31

            I use firebase_messaging for push notifications and to send the messages I use POST requests.

            When sending messages to FCM token it all works properly, but when sending them to topic (I basically modified the request I use for token messages) they won't get delivered.

            I checked and the topic is correct and on physical Android device I'm correctly subscripted to that topic, as when sending a topic message from FCM console it gets delivered immediately. Can you spot what I'm doing wrong here?

            Many thanks.

            token message (working): ...

            ANSWER

            Answered 2020-Aug-25 at 15:31

            everything you have done is correct in the topic messaging, but you have to modify your "to" key to this :

            Source https://stackoverflow.com/questions/63574994

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install webpush

            Add this line to your application's Gemfile:.

            Support

            Bug reports and pull requests are welcome on GitHub at https://github.com/zaru/webpush.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/zaru/webpush.git

          • CLI

            gh repo clone zaru/webpush

          • sshUrl

            git@github.com:zaru/webpush.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link