@gatling.io/http
Version: 
Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).
33 lines (32 loc) • 1.54 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Proxy = void 0;
const core_1 = require("@gatling.io/core");
const jvm_types_1 = require("@gatling.io/jvm-types");
const wrapProxy = (_underlying) => ({
    _underlying,
    http: () => wrapProxy(_underlying.http()),
    https: () => wrapProxy(_underlying.https()),
    socks4: () => wrapProxy(_underlying.socks4()),
    socks5: () => wrapProxy(_underlying.socks5()),
    credentials: (username, password) => wrapProxy(typeof username === "function"
        ? typeof password === "function"
            ? _underlying.credentials((0, core_1.underlyingSessionTo)(username), (0, core_1.underlyingSessionTo)(password))
            : _underlying.credentials((0, core_1.underlyingSessionTo)(username), password)
        : typeof password === "function"
            ? _underlying.credentials(username, (0, core_1.underlyingSessionTo)(password))
            : _underlying.credentials(username, password)),
    connectHeader: (name, value) => wrapProxy(typeof value === "function"
        ? _underlying.connectHeader(name, (0, core_1.underlyingSessionTo)(value))
        : _underlying.connectHeader(name, value)),
    connectHeaders: (headers) => wrapProxy(_underlying.connectHeaders((0, core_1.asJava)(headers)))
});
/**
 * Bootstrap the DSL for defining a Proxy
 *
 * @param host - the proxy host
 * @param port - the proxy prot
 * @returns the next DSL step
 */
const Proxy = (host, port) => wrapProxy(jvm_types_1.HttpDsl.Proxy(host, port));
exports.Proxy = Proxy;