ember-cli / ember-cli/ember-source-channel-url

Problem when behind corporate proxy

Open
#4 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10
Forks
4
PR merge metrics
No merged PRs in 30d

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:
```js
// 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
```js
// 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 ?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.