import type { IncomingMessage } from 'http'; import { Observable } from 'rxjs'; import type { Socket, Server, NetConnectOpts } from 'net'; import WebSocket from 'ws'; /** * Calculates the full request URL for the given message. * @param request The request. * @param protocol The protocol. */ export declare function requestUrl(request: IncomingMessage, protocol: string): URL; /** * Opens a socket connection. * @param options The options. */ export declare function connect(options: NetConnectOpts): Observable; /** * Listens for connections with the given server on the given port. * @param server The server. * @param port The port to listen on. */ export declare function listen(server: Server, port?: number): Observable; /** * Wraps the given socket in an observable. * @param connection The socket to wrap. */ export declare function cleanup(socket: Socket): Observable; /** * Opens a websocket connection to the given address. * @param address The address to open the connection to. * @param options The options to use. */ export declare function websocket(address: string, options?: WebSocket.ClientOptions): Observable; export declare function handleUpgrade(server: WebSocket.Server, req: IncomingMessage, socket: Socket, head: Buffer): Observable; /** * Gets an observable list of messages from the given websocket. * @param websocket The websocket. */ export declare function messages(websocket: WebSocket): Observable; export declare function completeWith(observable: Observable): import("rxjs").MonoTypeOperatorFunction; //# sourceMappingURL=utils.d.ts.map