From 1134780b8b89c96aa99a621008f06cafee8deda4 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 2 Jun 2021 13:29:20 -0700 Subject: [PATCH] refactor: make wsProxy async --- src/node/routes/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node/routes/index.ts b/src/node/routes/index.ts index c183b42b..42edbe11 100644 --- a/src/node/routes/index.ts +++ b/src/node/routes/index.ts @@ -98,8 +98,8 @@ export const register = async ( app.all("/proxy/(:port)(/*)?", (req, res) => { pathProxy.proxy(req, res) }) - wsApp.get("/proxy/(:port)(/*)?", (req) => { - pathProxy.wsProxy(req as pluginapi.WebsocketRequest) + wsApp.get("/proxy/(:port)(/*)?", async (req) => { + await pathProxy.wsProxy(req as pluginapi.WebsocketRequest) }) // These two routes pass through the path directly. // So the proxied app must be aware it is running @@ -109,8 +109,8 @@ export const register = async ( passthroughPath: true, }) }) - wsApp.get("/absproxy/(:port)(/*)?", (req) => { - pathProxy.wsProxy(req as pluginapi.WebsocketRequest, { + wsApp.get("/absproxy/(:port)(/*)?", async (req) => { + await pathProxy.wsProxy(req as pluginapi.WebsocketRequest, { passthroughPath: true, }) })