Skip to content

Instantly share code, notes, and snippets.


matzew/ Secret

Last active Oct 13, 2020
What would you like to do?
SimplePush Hack

SimplePush by hand

  1. establish WSS connection
var websocket = new WebSocket("wss://");
websocket.onopen = function(event) {alert("OPEN");};
websocket.onclose = function(e) {alert('closed')};
websocket.onmessage = function(e) {console.log(; };

once 'open'ed send HELLO:

var helloMsg = {messageType: "hello",uaid: "",channelIDs: []};
websocket.send(JSON.stringify( helloMsg ));

After payload received, did an register:

var reg = {"messageType": "register","channelID": "d9b74644-4f97-46aa-b8fa-9393985cd6cd"};
websocket.send(JSON.stringify( reg ));

From that payload, use the pushEndpoint URL string, in a cURL, like:

curl -i --header "Content-Type:application/x-www-form-urlencoded" -X PUT -d "version=2"

And noticed a logged update :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment