mockttp
Version:
Mock HTTP server for testing HTTP clients and stubbing webservices
22 lines • 1.1 kB
TypeScript
import { Writable } from 'stream';
import * as net from 'net';
import * as tls from 'tls';
import * as http from 'http';
import { DestroyableServer } from 'destroyable-server';
import { TlsHandshakeFailure } from '../types';
import { MockttpHttpsOptions } from '../mockttp';
import { SocksServerOptions } from './socks-server';
export interface ComboServerOptions {
debug: boolean;
https: MockttpHttpsOptions | undefined;
http2: boolean | 'fallback';
socks: boolean | SocksServerOptions;
passthroughUnknownProtocols: boolean;
keyLogStream: Writable | undefined;
requestListener: (req: http.IncomingMessage, res: http.ServerResponse) => void;
tlsClientErrorListener: (socket: tls.TLSSocket, req: TlsHandshakeFailure) => void;
tlsPassthroughListener: (socket: net.Socket, hostname: string, port?: number) => void;
rawPassthroughListener: (socket: net.Socket, hostname: string, port?: number) => void;
}
export declare function createComboServer(options: ComboServerOptions): Promise<DestroyableServer<net.Server>>;
//# sourceMappingURL=http-combo-server.d.ts.map