diff --git a/desktop/app/src/init.tsx b/desktop/app/src/init.tsx index 1bb6f7c37..77a2124ee 100644 --- a/desktop/app/src/init.tsx +++ b/desktop/app/src/init.tsx @@ -206,7 +206,6 @@ async function getFlipperServer( const {readyForIncomingConnections} = await startServer({ staticPath, entry: 'index.web.dev.html', - tcp: false, port, }); diff --git a/desktop/flipper-server-core/src/server/startServer.tsx b/desktop/flipper-server-core/src/server/startServer.tsx index 95554ded0..a9b8a0796 100644 --- a/desktop/flipper-server-core/src/server/startServer.tsx +++ b/desktop/flipper-server-core/src/server/startServer.tsx @@ -30,7 +30,6 @@ type Config = { port: number; staticPath: string; entry: string; - tcp: boolean; }; type ReadyForConnections = ( @@ -151,11 +150,6 @@ async function startProxyServer( // On Windows, a proxy is not created and the server starts // listening at the specified port. if (os.platform() === 'win32') { - if (!config.tcp) { - console.warn( - 'No port was supplied and domain socket access is not available for non-POSIX systems, falling back to TCP', - ); - } return new Promise((resolve) => { console.log(`Starting server on http://localhost:${config.port}`); const readyForIncomingConnections = ( @@ -182,13 +176,11 @@ async function startProxyServer( await fs.rm(socketPath, {force: true}); } - const proxyServer: proxy | undefined = config.tcp - ? proxy.createProxyServer({ - target: {host: 'localhost', port: 0, socketPath}, - autoRewrite: true, - ws: true, - }) - : undefined; + const proxyServer: proxy | undefined = proxy.createProxyServer({ + target: {host: 'localhost', port: 0, socketPath}, + autoRewrite: true, + ws: true, + }); console.log('Starting socket server on ', socketPath); if (proxyServer) { @@ -230,7 +222,6 @@ async function startProxyServer( server.listen(socketPath, undefined, () => { tracker.track('server-started', { port: config.port, - tcp: config.tcp, }); resolve(); }); @@ -275,8 +266,6 @@ function addWebsocket(server: http.Server, config: Config) { // No origin header? The request is not originating from a browser, so should be OK to pass through // If origin matches our own address, it means we are serving the page. - // Need the token or know that is UDS. - return process.env.SKIP_TOKEN_VERIFICATION ? true : verifyAuthToken(req); } else { // For now we don't allow cross origin request, so that an arbitrary website cannot try to @@ -299,10 +288,8 @@ function addWebsocket(server: http.Server, config: Config) { const options: ServerOptions = { noServer: true, maxPayload: WEBSOCKET_MAX_MESSAGE_SIZE, + verifyClient, }; - if (config.tcp) { - options.verifyClient = verifyClient; - } const wss = new WebSocketServer(options); server.on('upgrade', function upgrade(request, socket, head) { diff --git a/desktop/flipper-server-core/src/tracker.tsx b/desktop/flipper-server-core/src/tracker.tsx index 72e43eaf3..f694cec53 100644 --- a/desktop/flipper-server-core/src/tracker.tsx +++ b/desktop/flipper-server-core/src/tracker.tsx @@ -36,7 +36,7 @@ type ServerBootstrapPerformancePayload = { type TrackerEvents = { 'server-bootstrap-performance': ServerBootstrapPerformancePayload; - 'server-started': {port: number; tcp: boolean}; + 'server-started': {port: number}; 'server-auth-token-verification': { successful: boolean; present: boolean; diff --git a/desktop/flipper-server/src/index.tsx b/desktop/flipper-server/src/index.tsx index 01c8f0aa1..93dbf3ecc 100644 --- a/desktop/flipper-server/src/index.tsx +++ b/desktop/flipper-server/src/index.tsx @@ -208,7 +208,6 @@ async function start() { staticPath, entry: `index.web${argv.bundler ? '.dev' : ''}.html`, port: argv.port, - tcp: true, }); const t4 = performance.now();