I'm using this example code to learn Web Push.
https://github.com/Minishlink/web-push-php-example
I'm working on a web application that is hosted and used completely inhouse. The app should be able to send Web Push notifications to the users.
Security concerns prohibit to let the app send any informations to the internet.
Infrastructure roughly is like this:
The server hosting the app resides in a DMZ. Inhouse there are two subnets I and N. Clients from I have access to the internet, clients in N have not. From both subnets the clients can access the app server.
Now when I access the app from a client (Firefox) in subnet I the example code works fine. But using a client from subnet N ends with this error in the console:
Impossible to subscribe to push notification
DOMException code 20, message "Error retrieving push subscription"
The service worker has been registered.
Code execution in Firefox seems to abort in this line of the function push_subscribe() in app.js:
.then(subscription => {
In Chrome I even can't find any error output but code execution aborts in the same line.
What can cause this error? I'm not sure how the "no internet subnet" could be the reason because of my knowledge the function push_subscribe() doesn't trigger any connection attempts anywhere until abort. At least I can't see such hints in the network tab of Firefox' Debugging Tool.