Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions dist/anonymize_proxy.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import type { Buffer } from "node:buffer";
import type http from "node:http";
import type net from "node:net";
export interface AnonymizeProxyOptions {
url: string;
port: number;
ignoreProxyCertificate?: boolean;
}
/**
* Parses and validates a HTTP proxy URL. If the proxy requires authentication,
* or if it is an HTTPS proxy and `ignoreProxyCertificate` is `true`, then the function
* starts an open local proxy server that forwards to the upstream proxy.
*/
export declare const anonymizeProxy: (options: string | AnonymizeProxyOptions, callback?: ((error: Error | null) => void) | undefined) => Promise<string>;
/**
* Closes anonymous proxy previously started by `anonymizeProxy()`.
* If proxy was not found or was already closed, the function has no effect
* and its result if `false`. Otherwise the result is `true`.
* @param closeConnections If true, pending proxy connections are forcibly closed.
*/
export declare const closeAnonymizedProxy: (anonymizedProxyUrl: string, closeConnections: boolean, callback?: ((error: Error | null, result?: boolean) => void) | undefined) => Promise<boolean>;
type Callback = ({ response, socket, head, }: {
response: http.IncomingMessage;
socket: net.Socket;
head: Buffer;
}) => void;
/**
* Add a callback on 'tunnelConnectResponded' Event in order to get headers from CONNECT tunnel to proxy
* Useful for some proxies that are using headers to send information like ProxyMesh
* @returns `true` if the callback is successfully configured, otherwise `false` (e.g. when an
* invalid proxy URL is given).
*/
export declare const listenConnectAnonymizedProxy: (anonymizedProxyUrl: string, tunnelConnectRespondedCallback: Callback) => boolean;
export declare const statisticsAnonymizedProxy: (anonymizedProxyUrl: string) => number;
export {};
//# sourceMappingURL=anonymize_proxy.d.ts.map
1 change: 1 addition & 0 deletions dist/anonymize_proxy.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 113 additions & 0 deletions dist/anonymize_proxy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/anonymize_proxy.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions dist/chain.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import type { Buffer } from 'node:buffer';
import type dns from 'node:dns';
import type { EventEmitter } from 'node:events';
import type { URL } from 'node:url';
import type { Socket } from './socket';
export interface HandlerOpts {
upstreamProxyUrlParsed: URL;
ignoreUpstreamProxyCertificate: boolean;
localAddress?: string;
ipFamily?: number;
dnsLookup?: typeof dns['lookup'];
customTag?: unknown;
}
interface ChainOpts {
request: {
url?: string;
};
sourceSocket: Socket;
head?: Buffer;
handlerOpts: HandlerOpts;
server: EventEmitter & {
log: (connectionId: unknown, str: string) => void;
};
isPlain: boolean;
}
/**
* Passes the traffic to upstream HTTP proxy server.
* Client -> Apify -> Upstream -> Web
* Client <- Apify <- Upstream <- Web
*/
export declare const chain: ({ request, sourceSocket, head, handlerOpts, server, isPlain, }: ChainOpts) => void;
export {};
//# sourceMappingURL=chain.d.ts.map
1 change: 1 addition & 0 deletions dist/chain.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

146 changes: 146 additions & 0 deletions dist/chain.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading