ssrf-req-filter
ssrf-req-filter copied to clipboard
HTTP Proxy is not well supported in HTTPS connection.
Axios does support http proxy when https connection while manageConnection
enforces http proxy for http connection and https proxy for https connection.
example
const axios = require('axios');
const url = 'https://echo.hoppscotch.io';
const ssrfFilter = require('ssrf-req-filter');
axios({
url,
proxy: {
protocol: 'http',
host: '127.0.0.1',
port: 8080
}, httpAgent: ssrfFilter(url), httpsAgent: ssrfFilter(url)
})
.then((response) => {
console.log(`Success`);
})
.catch((error) => {
console.log(`${error.toString().split('\n')[0]}`);
})
.then(() => {
});
error: TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"
It works without ssrfFilter
.