Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Proxy is not well supported in HTTPS connection. #42

Open
zhzy0077 opened this issue Feb 26, 2024 · 0 comments
Open

HTTP Proxy is not well supported in HTTPS connection. #42

zhzy0077 opened this issue Feb 26, 2024 · 0 comments

Comments

@zhzy0077
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant