proxying websocket endpoint in nextjs
Unanswered
Kerry Blue Terrier posted this in #help-forum
Kerry Blue TerrierOP
i am proxying my backend api in the
the api route for the ws is
im unable to connect to it, and i dont see any logs on the backend
do i need to do something to proxy ws endpoints?
next.config.js async rewrites() {
const development = process.env.NEXT_PUBLIC_ENV === "development";
const BASEURL = development
? process.env.NEXT_PUBLIC_DEV_URL
: process.env.NEXT_PUBLIC_PROD_URL;
return [
{
source: "/api/:path*/",
destination: `${BASEURL}/api/:path*/`, // Proxy to the appropriate URL based on the environment
},
];
},the api route for the ws is
/api/wsim unable to connect to it, and i dont see any logs on the backend
do i need to do something to proxy ws endpoints?