athombv / homey-apps-sdk-issues

This issue tracker is for Homey Developers using the Apps SDK.
21 stars 4 forks source link

Add features for permit to set a specific fixed host ip in /homey/lib/app.js (Line 648) #329

Closed te85va closed 5 months ago

te85va commented 11 months ago

For some custom network environment (like behind NAT) it will be useful to permit to specify a fixed host ip.

For example in my case the workaround that I have done for solve my problem was to insert this condition:

// FIX: if exists env HOMEY_HOST use this fixed ip instead of 172.17.0.1

const host = _(process.env && process.env.HOMEY_HOST) ? process.env.HOMEY_HOST :_ (process.platform === 'linux') ? isWsl // Windows Subsystem for Linux ? await new Promise((resolve, reject) => { childProcess.exec('wsl.exe hostname -I', (err, stdout) => { if (err) return reject(err); return resolve(stdout.trim()); }); }) : '172.17.0.1' : 'host.docker.internal';