Skip to content

Commit

Permalink
fix: terminate WebSocket connections before closing WebSocket server (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fwouts committed Dec 16, 2021
1 parent 717cb08 commit b9871bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/vite/src/node/server/ws.ts
Expand Up @@ -114,6 +114,9 @@ export function createWebSocketServer(

close() {
return new Promise((resolve, reject) => {
wss.clients.forEach((client) => {
client.terminate()
})
wss.close((err) => {
if (err) {
reject(err)
Expand Down

0 comments on commit b9871bb

Please sign in to comment.