feat: 更新WebSocket 优化逻辑

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2021-08-03 16:59:43 +08:00
parent def62e2940
commit 586b6acbbc
45 changed files with 5465 additions and 2376 deletions

View File

@@ -0,0 +1,27 @@
/**
* Module dependencies.
*/
import * as server from "../server"
// const http = require("http")
// const Server = require("./server")
import { Server } from './server'
/**
* Captures upgrade requests for a http.Server.
*
* @param {http.Server} server
* @param {Object} options
* @return {Server} engine server
* @api public
*/
function attach(srv, options) {
const engine = new Server(options)
engine.attach(server.attach(srv, options), options)
return engine
}
export = {
attach
}