Skip to content

Problem when behind corporate proxy #4

@ghost

Description

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions