Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Running in Docker

For APNs currently, just run this:

docker run -p 16002-16003:16002-16003 aerogear/push-network-proxies


Proxy acts as a fake notification provider (APNS / FCM). From consumer point of view, the notifications which the consumer sends to networks hit this proxy and proxy answers the consumer back as if the response came from the real providers.

This project is used for testing purposes.

Installation is done by mvn clean install. Resulting binary is in impl/target/proxy.

Proxy binary offers two commands. Every command covers the proxy for one notification platform. There are two platfroms implemented - APNS and FCM

If you want to start proxy for both networks, you have to have two running binaries of proxy.
$ ./proxy help
usage: proxy <command> [<args>]

The most commonly used proxy commands are:
    apnsProxy   starts APNS proxy
    fcmProxy    starts FCM proxy
    help        Display help information

APNS proxy

APNS proxy is started by apnsProxy command.

$ ./proxy help apnsProxy
        proxy apnsProxy - starts APNS proxy

        proxy apnsProxy [--apnsKeystore <apnsKeystore>]
                [--apnsKeystoreAlgorithm <apnsKeystoreAlgorithm>]
                [--apnsKeystorePassword <apnsKeystorePassword>]
                [--apnsKeystoreType <apnsKeystoreType>]
                [--apnsMockFeedbackHost <apnsMockFeedbackHost>]
                [--apnsMockFeedbackPort <apnsMockFeedbackPort>]
                [--apnsMockGatewayHost <apnsMockGatewayHost>]
                [--apnsMockGatewayPort <apnsMockGatewayPort>]
                [--notificationEndpointHost <notificationEndpointHost>]
                [--notificationEndpointPort <notificationEndpointPort>]

        --apnsKeystore <apnsKeystore>
            defaults to serverStore.p12 loaded from the jar

        --apnsKeystoreAlgorithm <apnsKeystoreAlgorithm>
            defaults to sunx509

        --apnsKeystorePassword <apnsKeystorePassword>
            defaults to 123456

        --apnsKeystoreType <apnsKeystoreType>
            defaults to PKCS12

        --apnsMockFeedbackHost <apnsMockFeedbackHost>
            defaults to

        --apnsMockFeedbackPort <apnsMockFeedbackPort>
            defaults to 16003

        --apnsMockGatewayHost <apnsMockGatewayHost>
            defaults to

        --apnsMockGatewayPort <apnsMockGatewayPort>
            defaults to 16002

        --notificationEndpointHost <notificationEndpointHost>
            defaults to

        --notificationEndpointPort <notificationEndpointPort>
            defaults to 17000

FCM proxy

FCM proxy is started by fcmProxy command.

FCM proxy is quite complex to implement due to impossibility of the FCM client library to say where you wish to route the notifications to be sent. You can not set another addresses of FCM notification servers as you can do with APNS client library hence some kind of MITM attack on the certificate level is needed.

$ ./proxy help fcmProxy
        proxy fcmProxy - starts FCM proxy

        proxy fcmProxy --fcmCertificate <fcmCertificate>
                --fcmCertificateKey <fcmCertificateKey>
                [--fcmMockServerHost <fcmMockServerHost>]
                [--fcmMockServerPort <fcmMockServerPort>]
                [--httpProxyHost <httpProxyHost>] [--httpProxyPort <httpProxyPort>]
                [--notificationEndpointHost <notificationEndpointHost>]
                [--notificationEndpointPort <notificationEndpointPort>]

        --fcmCertificate <fcmCertificate>

        --fcmCertificateKey <fcmCertificateKey>

        --fcmMockServerHost <fcmMockServerHost>
            defaults to

        --fcmMockServerPort <fcmMockServerPort>
            defaults to 16001

        --httpProxyHost <httpProxyHost>
            defaults to

        --httpProxyPort <httpProxyPort>
            defaults to 16000

        --notificationEndpointHost <notificationEndpointHost>
            defaults to

        --notificationEndpointPort <notificationEndpointPort>
            defaults to 17000

Notification register endpoint

After you send some notifications to this proxy, they are internally cached so you can query the proxy instance what notifications it received so far.

You get these notifications by performing GET on address notificationEndpointHost:notificationEndpointPort.

The received JSON is just serialized model class you find in model artifact.

You can of course unmarshall the JSON at client side into model classes and work with them further as you wish.

You can clear all gathered notifications by calling notificationEndpointHost:notificationEndpointPort/clear.

You can’t perform that action at this time.