serverEntry
example that shows how to integrate with socket.io.
The trick is to attach the socket.io server to viteDevServer.httpServer
(from "vavite/vite-dev-server"
) and not to httpDevServer
from "vavite/http-dev-server"
. The latter is merely a proxy to force server frameworks to behave in a controlled manner, the former is the actual server used by Vite.
Clone with:
npx degit cyco130/vavite/examples/socket-io