ssrf-req-filter icon indicating copy to clipboard operation
ssrf-req-filter copied to clipboard

HTTP Proxy is not well supported in HTTPS connection.

Open zhzy0077 opened this issue 1 year ago • 0 comments

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.

zhzy0077 avatar Feb 26 '24 07:02 zhzy0077