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

2.1.0 - Protocol https not supported. Expected http #38

Open
mfinegold-cambia opened this issue Nov 24, 2020 · 1 comment
Open

2.1.0 - Protocol https not supported. Expected http #38

mfinegold-cambia opened this issue Nov 24, 2020 · 1 comment

Comments

@mfinegold-cambia
Copy link

Hello, we're on an old version of node ( v8.16.1 ) and superagent ( 4.1.0 ), and noticed when we upgraded to your new superagent-proxy version 2.1.0 recently that it broke our code that uses it to make a https call though our company egress proxy. The same code was working fine with superagent-proxy 2.0.0.

The error making the https call was "Error: Protocol https not supported. Expected http:"

For now we'll revert to using 2.0.0, but wondering if any idea?

@alexjab
Copy link

alexjab commented Nov 10, 2021

I'm having the same issue under very specific circumstances.

The issue started to appear once we installed Sentry (I know this looks bad, but even without Sentry there should have been logs if the error occurred before).

Downgrading superagent-proxy to 2.0.0 or disabling Sentry or upgrading Sentry to 6.14.1 seems to work.

Also I found this getsentry/sentry-javascript#4080

Config:

  • node 12.16.3
  • superagent 6.1.0
  • superagent-proxy 2.1.0
  • @sentry/node 6.14.0

Code to reproduce:

const request = require('superagent');
const proxy = require('superagent-proxy');
const Sentry = require('@sentry/node');


Sentry.init({
  dsn: '<Your sentry DSN>',
});

proxy(request);

async function main() {
  try {
    const {text} = await request
      .get('https://example.com')
      .proxy('<Your proxy URL>');

    console.log(text);
  } catch (err) {
    console.error(err);
  }
}

main();

Hope this helps

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

2 participants