UDS/TCP options
Summary: Provide an option to enable/disable TCP connections on flipper-server. The only change at this stage is that Flipper Desktop will use UDS to connect to flipper-server. Reviewed By: passy Differential Revision: D37519656 fbshipit-source-id: 3d02084666fde532ec76134edf8cf6a231060a48
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f46cf2b0ce
commit
646b9d5a5d
@@ -23,7 +23,7 @@ const argv = yargs
|
||||
.usage('yarn flipper-server [args]')
|
||||
.options({
|
||||
port: {
|
||||
describe: 'Port to serve on',
|
||||
describe: 'TCP port to serve on',
|
||||
type: 'number',
|
||||
default: 52342,
|
||||
},
|
||||
@@ -55,6 +55,12 @@ const argv = yargs
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
},
|
||||
tcp: {
|
||||
describe:
|
||||
'Open a TCP port (--no-tcp can be specified as to use unix-domain-socket exclusively)',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
},
|
||||
})
|
||||
.version('DEV')
|
||||
.help()
|
||||
@@ -94,9 +100,10 @@ async function start() {
|
||||
}
|
||||
|
||||
const {app, server, socket, readyForIncomingConnections} = await startServer({
|
||||
port: argv.port,
|
||||
staticDir,
|
||||
entry: `index.web${argv.bundler ? '.dev' : ''}.html`,
|
||||
port: argv.port,
|
||||
tcp: argv.tcp,
|
||||
});
|
||||
|
||||
const flipperServer = await startFlipperServer(
|
||||
@@ -150,6 +157,10 @@ process.on('unhandledRejection', (reason, promise) => {
|
||||
|
||||
start()
|
||||
.then(() => {
|
||||
if (!argv.tcp) {
|
||||
console.log('Flipper server started and listening');
|
||||
return;
|
||||
}
|
||||
console.log(
|
||||
'Flipper server started and listening at port ' + chalk.green(argv.port),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user