Archived
1
0

refactor: make wsProxy async

This commit is contained in:
Joe Previte 2021-06-02 13:29:20 -07:00
parent 91303d4e40
commit 1134780b8b
No known key found for this signature in database
GPG Key ID: 2C91590C6B742C24

View File

@ -98,8 +98,8 @@ export const register = async (
app.all("/proxy/(:port)(/*)?", (req, res) => { app.all("/proxy/(:port)(/*)?", (req, res) => {
pathProxy.proxy(req, res) pathProxy.proxy(req, res)
}) })
wsApp.get("/proxy/(:port)(/*)?", (req) => { wsApp.get("/proxy/(:port)(/*)?", async (req) => {
pathProxy.wsProxy(req as pluginapi.WebsocketRequest) await pathProxy.wsProxy(req as pluginapi.WebsocketRequest)
}) })
// These two routes pass through the path directly. // These two routes pass through the path directly.
// So the proxied app must be aware it is running // So the proxied app must be aware it is running
@ -109,8 +109,8 @@ export const register = async (
passthroughPath: true, passthroughPath: true,
}) })
}) })
wsApp.get("/absproxy/(:port)(/*)?", (req) => { wsApp.get("/absproxy/(:port)(/*)?", async (req) => {
pathProxy.wsProxy(req as pluginapi.WebsocketRequest, { await pathProxy.wsProxy(req as pluginapi.WebsocketRequest, {
passthroughPath: true, passthroughPath: true,
}) })
}) })