rschmied
devProxy with path both for regular requests and websockets
I am building a GraphQL application where the API endpoint is on
The below obviously doesn't work as is, duplicate key and such: I experimented with creating a separate Nuxt module which handles
/query
. I want the devProxy to proxy regular requests AND websocket requests to the same endpoint. However, I can't figure out how to do this properly.The below obviously doesn't work as is, duplicate key and such: I experimented with creating a separate Nuxt module which handles
.on("upgrade")
but having the devProxy and some other part of the code handling proxy requests seem to interfere which each other. And no, I don't want to change the server / GraphQL logic. It works all fine when running outside the dev environment. Module based on this.
Is there a canonical / supported way to do what I have in mind?
This uses 3.15.0 for Nuxt and I guess there's no easy way to reproduce this as it requires a functional back-end.
FWIW, this used to work when Nuxt was using node-http-proxy where the signature for ws was proxy.ws(req, socket, head)
E.g. the options weren't passed in as the 3rd arg.
Thanks!8 replies