mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
feat: http与ws允许监听同一端口,快速登录允许自动选择QQ号,允许禁用webUI
This commit is contained in:
@@ -73,7 +73,11 @@ export class NapCatOnebot11 {
|
||||
ob11HTTPServer.start(ob11Config.http.port, ob11Config.http.host);
|
||||
}
|
||||
if (ob11Config.ws.enable) {
|
||||
ob11WebsocketServer.start(ob11Config.ws.port, ob11Config.ws.host);
|
||||
if (ob11Config.http.port == ob11Config.ws.port && ob11Config.http.host == ob11Config.ws.host && ob11HTTPServer.server) {
|
||||
ob11WebsocketServer.start(ob11HTTPServer.server);
|
||||
} else {
|
||||
ob11WebsocketServer.start(ob11Config.ws.port, ob11Config.ws.host);
|
||||
}
|
||||
}
|
||||
if (ob11Config.reverseWs.enable) {
|
||||
ob11ReverseWebsockets.start();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { WebSocket } from 'ws';
|
||||
import http from 'http';
|
||||
import { actionMap } from '../../action';
|
||||
import { OB11Response } from '../../action/OB11Response';
|
||||
import { postWsEvent, registerWsEventSender, unregisterWsEventSender } from '../postOB11Event';
|
||||
@@ -18,7 +19,7 @@ const heartbeatRunning = false;
|
||||
|
||||
class OB11WebsocketServer extends WebsocketServerBase {
|
||||
|
||||
public start(port: number, host: string) {
|
||||
public start(port: number | http.Server, host: string = '') {
|
||||
this.token = ob11Config.token;
|
||||
super.start(port, host);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user