Define alt ports for web socket connections
Summary: The changes below add the notion of alternative ports to Flipper. These alternative ports are meant to and will be used to connect via WebSocket instead of RSocket. The name does not suggest that as to make as generic as possible so that they can be reused for different purposes in the future. Reviewed By: passy Differential Revision: D30898874 fbshipit-source-id: 5eed8c61b41b502c859192aaac59c284b7b36228
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6359c82be1
commit
1390bf4a33
@@ -125,10 +125,15 @@ class ServerController extends EventEmitter implements ServerEventsListener {
|
||||
this.initialized = this.certificateProvider
|
||||
.loadSecureServerConfig()
|
||||
.then((options) => {
|
||||
console.log('[conn] secure server listening at port: ', secure);
|
||||
this.secureServer = createServer(secure, this, options);
|
||||
if (GK.get('flipper_websocket_server')) {
|
||||
const {secure: altSecure} =
|
||||
this.store.getState().application.altServerPorts;
|
||||
console.log(
|
||||
'[conn] secure server (ws) listening at port: ',
|
||||
altSecure,
|
||||
);
|
||||
this.altSecureServer = createServer(
|
||||
altSecure,
|
||||
this,
|
||||
@@ -138,10 +143,15 @@ class ServerController extends EventEmitter implements ServerEventsListener {
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
console.log('[conn] insecure server listening at port: ', insecure);
|
||||
this.insecureServer = createServer(insecure, this);
|
||||
if (GK.get('flipper_websocket_server')) {
|
||||
const {insecure: altInsecure} =
|
||||
this.store.getState().application.altServerPorts;
|
||||
console.log(
|
||||
'[conn] insecure server (ws) listening at port: ',
|
||||
altInsecure,
|
||||
);
|
||||
this.altInsecureServer = createServer(
|
||||
altInsecure,
|
||||
this,
|
||||
|
||||
Reference in New Issue
Block a user