完成http、https修改
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import * as websocket from "ws";
|
||||
import { Server } from 'http';
|
||||
import { Server as HttpServer } from 'http';
|
||||
import { Server as HttpsServer } from 'https';
|
||||
import * as handler from "./class/websockethandler";
|
||||
import { log, LogLevel } from './log';
|
||||
|
||||
export default class WSSignaling {
|
||||
server: Server;
|
||||
server: HttpServer | HttpsServer;
|
||||
wss: websocket.Server;
|
||||
|
||||
/**
|
||||
@@ -12,7 +13,7 @@ export default class WSSignaling {
|
||||
* @param server HTTP服务器实例
|
||||
* @param mode 通信模式(public或private)
|
||||
*/
|
||||
constructor(server: Server, mode: string) {
|
||||
constructor(server: HttpServer | HttpsServer, mode: string) {
|
||||
// 保存服务器实例
|
||||
this.server = server;
|
||||
// 创建WebSocket服务器
|
||||
|
||||
Reference in New Issue
Block a user