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

Problem when behind corporate proxy #4

Open
ghost opened this issue May 18, 2018 · 1 comment · May be fixed by #235
Open

Problem when behind corporate proxy #4

ghost opened this issue May 18, 2018 · 1 comment · May be fixed by #235

Comments

@ghost
Copy link

ghost commented May 18, 2018

When behind a proxy, ember try:each will not work as the HTTP request will fall in timeout.

Here is a proposition of a correction:

// index.js
'use strict';
const got = require('got');

module.exports = function(channelType, options = {}) {
  let HOST = process.env.EMBER_SOURCE_CHANNEL_URL_HOST || 'https://s3.amazonaws.com';
  let PATH = 'builds.emberjs.com';

  return got(`${HOST}/${PATH}/${channelType}.json`, Object.assign({}, { json: true }, options)).then(
    result => `${HOST}/${PATH}${result.body.assetPath}`
  );
};

Then, the user is responsible to update its own ember-try.js configuration

// config/ember-try.js
const getChannelURL = require('ember-source-channel-url');
const tunnel = require('tunnel-agent');

const options = {
  agent: tunnel.httpOverHttp({
    proxy: {
      host: 'myproxy.mycompany.com',
      port: 8080
    }
  })
};

module.exports = function() {
  return Promise.all([
    getChannelURL('release', options),
    getChannelURL('beta', options),
    getChannelURL('canary', options)
  ]).then((urls) => {
  ...

What do you think of this ?

@jelhan
Copy link

jelhan commented Aug 17, 2022

We are also running into this issue. Another option would be supporting HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables. Most tools respect these environment variables. So it would make usage much easier, if ember-source-channel-url (and indirectly ember-try) would respect it as well.

We are having a hard-time providing a work-around because one tool used by ember-try respects the environment variables (yarn) but another one does not (ember-source-channel-url). This makes it even more difficult to use proxychains as a work-around. Because it tries route a network request through a proxy twice if the program supports proxy through the environment variables as well.

@jelhan jelhan linked a pull request Aug 23, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant