UNPKG

mockttp

Version:

Mock HTTP server for testing HTTP clients and stubbing webservices

20 lines 1.03 kB
import net = require('net'); import tls = require('tls'); import http = require('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; 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