ClearVision/types/servers/HttpServer.d.ts

35 lines
1.8 KiB
TypeScript
Raw Normal View History

2022-07-09 16:03:26 -04:00
/// <reference types="node" />
2022-10-06 23:29:01 -04:00
import http, { IncomingMessage, ServerResponse } from "http";
import WebSocket from "ws";
import { ApplicationContext } from "../context/ApplicationContext";
2022-07-09 16:03:26 -04:00
import { HttpServerHelper } from "../helpers/HttpServerHelper";
import { NotifierHelper } from "../helpers/NotifierHelper";
import { INotification } from "../models/eft/notifier/INotifier";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { RandomUtil } from "../utils/RandomUtil";
import { ConfigServer } from "./ConfigServer";
import { DatabaseServer } from "./DatabaseServer";
2022-10-06 23:29:01 -04:00
import { IHttpListener } from "./http/IHttpListener";
export declare class HttpServer {
2022-07-09 16:03:26 -04:00
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer;
protected notifierHelper: NotifierHelper;
protected httpServerHelper: HttpServerHelper;
2022-10-06 23:29:01 -04:00
protected httpListeners: IHttpListener[];
2022-07-09 16:03:26 -04:00
protected configServer: ConfigServer;
2022-10-06 23:29:01 -04:00
protected applicationContext: ApplicationContext;
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext);
2022-07-09 16:03:26 -04:00
protected httpConfig: IHttpConfig;
protected webSockets: {};
protected websocketPingHandler: any;
getCookies(req: http.IncomingMessage): any;
sendMessage(sessionID: string, output: INotification): void;
isConnectionWebSocket(sessionID: string): boolean;
2022-10-06 23:29:01 -04:00
handleRequest(req: IncomingMessage, resp: ServerResponse): void;
2022-07-09 16:03:26 -04:00
load(): void;
protected getRandomisedMessage(): string;
2022-10-06 23:29:01 -04:00
protected wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void;
2022-07-09 16:03:26 -04:00
}