mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 18:39:22 +08:00
Merge pull request #1037 from TriliumNext/renovate/ws-8.x
chore(deps): update dependency @types/ws to v8.5.14
This commit is contained in:
commit
8e62c942ea
8
package-lock.json
generated
8
package-lock.json
generated
@ -147,7 +147,7 @@
|
||||
"@types/stream-throttle": "0.1.4",
|
||||
"@types/tmp": "0.2.6",
|
||||
"@types/turndown": "5.0.5",
|
||||
"@types/ws": "8.5.13",
|
||||
"@types/ws": "8.5.14",
|
||||
"@types/xml2js": "0.4.14",
|
||||
"@types/yargs": "17.0.33",
|
||||
"@vitest/coverage-v8": "3.0.4",
|
||||
@ -4126,9 +4126,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/ws": {
|
||||
"version": "8.5.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.13.tgz",
|
||||
"integrity": "sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA==",
|
||||
"version": "8.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.14.tgz",
|
||||
"integrity": "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
@ -189,7 +189,7 @@
|
||||
"@types/stream-throttle": "0.1.4",
|
||||
"@types/tmp": "0.2.6",
|
||||
"@types/turndown": "5.0.5",
|
||||
"@types/ws": "8.5.13",
|
||||
"@types/ws": "8.5.14",
|
||||
"@types/xml2js": "0.4.14",
|
||||
"@types/yargs": "17.0.33",
|
||||
"@vitest/coverage-v8": "3.0.4",
|
||||
|
@ -1,4 +1,4 @@
|
||||
import WebSocket from "ws";
|
||||
import { WebSocketServer as WebSocketServer, WebSocket } from "ws";
|
||||
import { isElectron, randomString } from "./utils.js";
|
||||
import log from "./log.js";
|
||||
import sql from "./sql.js";
|
||||
@ -10,7 +10,7 @@ import becca from "../becca/becca.js";
|
||||
import AbstractBeccaEntity from "../becca/entities/abstract_becca_entity.js";
|
||||
|
||||
import env from "./env.js";
|
||||
import type { IncomingMessage, Server } from "http";
|
||||
import type { IncomingMessage, Server as HttpServer } from "http";
|
||||
import type { EntityChange } from "./entity_changes_interface.js";
|
||||
|
||||
if (env.isDev()) {
|
||||
@ -24,7 +24,7 @@ if (env.isDev()) {
|
||||
.on("unlink", debouncedReloadFrontend);
|
||||
}
|
||||
|
||||
let webSocketServer!: WebSocket.Server;
|
||||
let webSocketServer!: WebSocketServer;
|
||||
let lastSyncedPush: number | null = null;
|
||||
|
||||
interface Message {
|
||||
@ -58,8 +58,8 @@ interface Message {
|
||||
}
|
||||
|
||||
type SessionParser = (req: IncomingMessage, params: {}, cb: () => void) => void;
|
||||
function init(httpServer: Server, sessionParser: SessionParser) {
|
||||
webSocketServer = new WebSocket.Server({
|
||||
function init(httpServer: HttpServer, sessionParser: SessionParser) {
|
||||
webSocketServer = new WebSocketServer({
|
||||
verifyClient: (info, done) => {
|
||||
sessionParser(info.req, {}, () => {
|
||||
const allowed = isElectron() || (info.req as any).session.loggedIn || (config.General && config.General.noAuthentication);
|
||||
|
Loading…
x
Reference in New Issue
Block a user