Skip to content

Commit

Permalink
try proxy for cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
saikrishna321 committed Oct 24, 2023
1 parent e2ec679 commit 66c5588
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions server-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"device-farm": {
"platform": "android",
"skipChromeDownload": true,
"proxy": {
"host": "10.32.80.80",
"port": 800,
"auth": { "username": "username", "password": "password" }
},
"derivedDataPath": {
"simulator": "/Users/saikrishna/Library/Developer/Xcode/DerivedData/WebDriverAgent-Test"
}
Expand Down
13 changes: 8 additions & 5 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ import { ADB } from 'appium-adb';

const commandsQueueGuard = new AsyncLock();
const DEVICE_MANAGER_LOCK_NAME = 'DeviceManager';
let platform: any;
let androidDeviceType: any;
let iosDeviceType: any;
let skipChromeDownload: any;
let emulators: any;
let proxy: any;

class DevicePlugin extends BasePlugin {
constructor(pluginName: string, cliArgs: any) {
Expand All @@ -64,18 +70,14 @@ class DevicePlugin extends BasePlugin {
}

public static async updateServer(expressApp: any, httpServer: any, cliArgs: any): Promise<void> {
let platform;
let androidDeviceType;
let iosDeviceType;
let skipChromeDownload;
let emulators;
registerProxyMiddlware(expressApp);

if (cliArgs.plugin && cliArgs.plugin['device-farm']) {
platform = cliArgs.plugin['device-farm'].platform;
androidDeviceType = cliArgs.plugin['device-farm'].androidDeviceType || 'both';
iosDeviceType = cliArgs.plugin['device-farm'].iosDeviceType || 'both';
skipChromeDownload = cliArgs.plugin['device-farm'].skipChromeDownload;
proxy = cliArgs.plugin['device-farm'].proxy;
emulators = Object.hasOwn(cliArgs.plugin['device-farm'], 'emulators');
}

Expand Down Expand Up @@ -214,6 +216,7 @@ class DevicePlugin extends BasePlugin {
const config = {
method: 'post',
url: remoteUrl,
proxy,
headers: {
'Content-Type': 'application/json',
},
Expand Down

0 comments on commit 66c5588

Please sign in to comment.