emschwartz / ilp3

An implementation of Interledger V3
5 stars 3 forks source link

Option for HTTP proxy #5

Closed dappelt closed 6 years ago

dappelt commented 6 years ago

I added some code for using an HTTP proxy, thought you might want to include something similar. Makes it easier to see (and mess) with the HTTP requests sent on the wire.

In http.js

const HttpsProxyAgent = require('https-proxy-agent')
...
      response = await fetch(url.format(parsedUri, { auth: false }), {
        method: 'POST',
        headers,
        body: transfer.data,
        compress: false,
        agent: new HttpsProxyAgent('http://127.0.0.1:8080')
      })
emschwartz commented 6 years ago

Couldn't you just set the uri to point to your proxy instead?

dappelt commented 6 years ago

No, uri needs to point at the connector. An HTTP proxy just forwards requests/responses.

To give a bit more background, the reason I bring this up is that there are security testing tools that act as an HTTP proxy (e.g. Burp Suite). Routing all HTTP traffic through such a tool makes it easy to analyze and manipulate HTTP requests/responses.