Skip to content

Use proxy-lib package when working behind proxy #3253

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

Merged
merged 1 commit into from
Dec 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions lib/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,6 @@ interface IInfoService {
printComponentsInfo(): Promise<void>;
}

/**
* Describes standard username/password type credentials.
*/
interface ICredentials {
username: string;
password: string;
}

/**
* Describes properties needed for uploading a package to iTunes Connect
*/
Expand Down
8 changes: 7 additions & 1 deletion lib/services/analytics/google-analytics-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export class GoogleAnalyticsProvider implements IGoogleAnalyticsProvider {
constructor(private clientId: string,
private $staticConfig: IStaticConfig,
private $analyticsSettingsService: IAnalyticsSettingsService,
private $logger: ILogger) {
private $logger: ILogger,
private $proxyService: IProxyService) {
}

public async trackHit(trackInfo: IGoogleAnalyticsData): Promise<void> {
Expand All @@ -27,11 +28,16 @@ export class GoogleAnalyticsProvider implements IGoogleAnalyticsProvider {
}

private async track(gaTrackingId: string, trackInfo: IGoogleAnalyticsData, sessionId: string): Promise<void> {
const proxySettings = await this.$proxyService.getCache();
const proxy = proxySettings && proxySettings.proxy;
const visitor = ua({
tid: gaTrackingId,
cid: this.clientId,
headers: {
["User-Agent"]: this.$analyticsSettingsService.getUserAgentString(`tnsCli/${this.$staticConfig.version}`)
},
requestOptions: {
proxy
}
});

Expand Down
140 changes: 140 additions & 0 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"plistlib": "0.2.1",
"progress-stream": "1.1.1",
"properties-parser": "0.2.3",
"proxy-lib": "0.2.0",
"qr-image": "3.2.0",
"request": "2.81.0",
"semver": "5.3.0",
Expand Down