-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for websocket handler
- Loading branch information
Showing
9 changed files
with
124 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,8 @@ | |
}, | ||
"devDependencies": { | ||
"better-sqlite3": "^11.8.1" | ||
}, | ||
"resolutions": { | ||
"h3": "^1.14.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export default defineWebSocketHandler({ | ||
// async upgrade(request) { | ||
// const session = await getUserSession(request) | ||
// console.log(`[upgrade] Session id: ${session.id}`) | ||
// return {} | ||
// }, | ||
async open(peer) { | ||
// const session = await getUserSession(peer.request) | ||
// console.log(`[open] Session:`, session) | ||
// peer.send(`Hello, ${session.id}!`) | ||
}, | ||
message(peer, message) { | ||
Check failure on line 12 in playground/server/routes/ws/index.ts
|
||
// console.log('message', message) | ||
}, | ||
}) |
Oops, something went wrong.