Skip to content

Latest commit

 

History

History

socket-io

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Vavite socket.io example

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.

Try on StackBlitz

Clone with:

npx degit cyco130/vavite/examples/socket-io

All examples have "type": "module" in their package.json.

  • For Vite v2, remove it to use CommonJS (CJS).
  • If you want to use CommonJS with Vite v3+, add legacy.buildSsrCjsExternalHeuristics: true to your Vite config.