RSocket and WebSocket

Summary:
Enable Flipper Desktop to run both RSocket and WebSocket servers.

I've used 'alt' ports and/or server instead of tying the name explicitly to web sockets. This more general approach can be used later on to supply and use an alternative socket pair for other usages.

Reviewed By: fabiomassimo

Differential Revision: D30482531

fbshipit-source-id: a2c5f25b925c731e7970614b5ed987ce00219918
This commit is contained in:
Lorenzo Blasa
2021-09-10 10:04:52 -07:00
committed by Facebook GitHub Bot
parent ba87b51e92
commit 977cc7598e
4 changed files with 76 additions and 17 deletions

View File

@@ -94,4 +94,20 @@ export default (store: Store, _logger: Logger) => {
);
}
}
if (process.env.FLIPPER_ALT_PORTS) {
const portOverrides = parseFlipperPorts(process.env.FLIPPER_ALT_PORTS);
if (portOverrides) {
store.dispatch({
type: 'SET_ALT_SERVER_PORTS',
payload: portOverrides,
});
} else {
console.error(
`Ignoring malformed FLIPPER_ALT_PORTS env variable:
"${process.env.FLIPPER_ALT_PORTS || ''}".
Example expected format: "1111,2222".`,
);
}
}
};