Skip to content

Commit 489b054

Browse files
authored
feat(rnd-open): custom host option (#519)
1 parent a0253f9 commit 489b054

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

npm-package/bin/rndebugger-open.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ const argv = require('minimist')(process.argv.slice(2), {
2929
// Use expo packager port (getExpoPort) instead of RN packager default port (8081)
3030
'expo',
3131
],
32-
string: ['port'],
32+
string: ['port', 'host'],
3333
default: {
3434
inject: true,
3535
},
3636
});
3737

3838
let moduleName;
3939
argv.port = Number(argv.port) || (argv.expo ? getExpoPort() : defaultPort);
40-
if (argv.open && argv.port) {
40+
if (argv.open && (argv.port || argv.host)) {
4141
moduleName = '../lib/open';
4242
} else {
4343
moduleName = '../lib/main';

npm-package/src/open.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ function connectToRND(rndPath, log, cb) {
4444
});
4545
}
4646

47-
export default ({ port }, cb) => {
48-
const rndPath = `rndebugger://set-debugger-loc?host=localhost&port=${port}`;
47+
export default ({ port, host = 'localhost' }, cb) => {
48+
const rndPath = `rndebugger://set-debugger-loc?host=${host}&port=${port}`;
4949

5050
if (process.platform === 'darwin') {
5151
const env = Object.assign({}, process.env);

0 commit comments

Comments
 (0)