mirror of
https://github.com/coder/code-server.git
synced 2025-07-28 12:33:43 +08:00
Fix health socket not getting client messages
Forgot to resume. Went ahead and did the same for the test plugin although it only sends messages and doesn't receive any.
This commit is contained in:
@ -13,8 +13,8 @@ router.get("/", (req, res) => {
|
||||
export const wsRouter = WsRouter()
|
||||
|
||||
wsRouter.ws("/", async (req) => {
|
||||
wss.handleUpgrade(req, req.socket, req.head, (ws) => {
|
||||
ws.on("message", () => {
|
||||
wss.handleUpgrade(req, req.ws, req.head, (ws) => {
|
||||
ws.addEventListener("message", () => {
|
||||
ws.send(
|
||||
JSON.stringify({
|
||||
event: "health",
|
||||
@ -23,5 +23,6 @@ wsRouter.ws("/", async (req) => {
|
||||
}),
|
||||
)
|
||||
})
|
||||
req.ws.resume()
|
||||
})
|
||||
})
|
||||
|
@ -28,7 +28,8 @@ export const plugin: cs.Plugin = {
|
||||
wsRouter() {
|
||||
const wr = cs.WsRouter()
|
||||
wr.ws("/test-app", (req) => {
|
||||
cs.wss.handleUpgrade(req, req.socket, req.head, (ws) => {
|
||||
cs.wss.handleUpgrade(req, req.ws, req.head, (ws) => {
|
||||
req.ws.resume()
|
||||
ws.send("hello")
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user