Nywes / Dashboard

0 stars 0 forks source link

Fix websocket proxy problem #51

Closed The-Law-1 closed 2 years ago

The-Law-1 commented 2 years ago

Done, bug with proxy middleware forces this code: // * if this works, thanks to this: https://github.com/chimurai/http-proxy-middleware/discussions/582 const wsProxy = createProxyMiddleware("/cryptosocket", { target:http://${serverHost}:${webSocketPort}`, ws: true })

module.exports = function(app) { app.use( '/api', createProxyMiddleware({ target: http://${serverHost}:${serverPort}, //changeOrigin: true, }) ); app.use(wsProxy); // app.use( // '/cryptosocket', // createProxyMiddleware({ // target: http://${serverHost}:${webSocketPort}, // ws: true, // // changeOrigin: true, // }) // ); };`