Quasar应用Cloudflared Tunnel环境下WebSocket热重载配置问题
问题:Quasar通过Cloudflared Tunnel实现WebSocket热重载连接失败
我给Quasar应用配置了一条Cloudflared Tunnel,同时另一条隧道用于前端与Ruby on Rails后端的通信。目前两者的常规通信已经配置完成,但热重载功能所需的WebSocket连接始终无法正常工作。
现有Quasar配置文件
env: { API: ctx.dev ? 'https://example.com/api' : 'http://example.com/api/' } }, // Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-devServer devServer: { https: false, port: 3000, open: true, // opens browser window automatically proxy: { // proxy all requests starting with /api to your API '/api': { target: ctx.dev ? 'https://example.com/' : 'http://example.com/api/', changeOrigin: true, pathRewrite: { '^/api': '/api/v1' } } } },
已尝试的WebSocket代理配置(未解决问题)
'/ws': { target: ctx.dev ? 'https://example.com:3000/' // 这里填的是Cloudflared给前端生成的URL : 'http://example.com/api/', // 目前不影响 ws: true, changeOrigin: true }
内容的提问来源于stack exchange,提问作者carlos eduardo rodrguez huerta
相关产品推荐
相关产品推荐

