XMPP For The Web/Win ::: XMPP-FTW (1.18.0) Flattr this

XEP-0070 Verifying HTTP requests using XMPP

For more information on the process of verifying HTTP requests it is suggested that you look at the documentation for XEP-0070: Verifying HTTP requests via XMPP.

Receive a HTTP verification request

Requests are received as follows:

        socket.on(
            'xmpp.http.verify',
            function(data) { console.log(data) }
        )
        

Requests can come in the form of <iq/> or <message/> there are some minor differences to how the data is received and how a response is sent. These will be noted as required.

An example payload is as follows:

        {
            from: { domain: 'media.evilprofessor.co.uk' }  /* ...JID object... */
            id: 'abc-123',
            type: 'message',
            description: 'Did you request this file?',
            request: {
              method: 'GET',
              url: 'https://media.evilprofessor.co.uk/secret.txt',
              id: 'request-1'
            }
        }
        

Notes:

Verifying a request

        socket.send(
            'xmpp.http.confirm',
            { 
                "to": "media.evilprofessor.co.uk",
                "id": "abc-123",
                "type": "iq",
                "request": {
                    "url": "https://media.evilprofessor.co.uk/secret.txt",
                    "method": "GET",
                    "id": "request-1"
                }

            },
            function(error, data) { console.log(error, data) }
        )
        

Notes:

Denying a request

        socket.send(
            'xmpp.http.deny',
            { 
                "to": "media.evilprofessor.co.uk",
                "id": "abc-123",
                "type": "iq",
                "request": {
                    "url": "https://media.evilprofessor.co.uk/secret.txt",
                    "method": "GET",
                    "id": "request-1"
                }

            },
            function(error, data) { console.log(error, data) }
        )
        

Notes:

Pages

Fork me on GitHub