How to Test Mirroring API Subscriptions

The limitations of https callbackUrl and the nature of the signatures in general make it look like it can only be done with a public URL.

So far, I have come across two potential solutions that facilitate local development / debugging.

The first Subscription Proxy service offered by Google. This workaround essentially allows you to remove callbacks with SSL and proxy restrictions to your own URL.

The second and most useful way I found for local creation is to grab a subscription callback request (say from a public server) in a log, and then use curl to play that request on your local / dev machine using something like:

curl -H "Content-type: application/json" -X POST \ -d '{"json for":"the notification"}' http://localhost:8080/notify 

Since requests can sometimes be large, or you can test several types of callbacks, I also found it useful to put the JSON of the index request in different files (for example: timeline-respond.json ) and then run

 curl -H "Content-Type: application/json" \ --data @timeline-respond.json http://localhost:8080/notify 

I'm curious what other people are doing to check their app subscriptions locally.

+7
source share
2 answers

The command line twisting method you mention is the best I've found so far.

I experimented with other solutions, such as a targeted subscription to App Engine, combined with a local script that pulls out this App Engine service for new notifications to be localhost to localhost , but so far I have not found one that is worth the extra complexity.

Alternatively, many localhost proxies are available. My favorite is ngrok.com .

+3
source

You might want to give localtunnel a try.

0
source

All Articles