"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MockProxy = void 0;
const tslib_1 = require("tslib");
const http_1 = require("http");
const proxy_1 = tslib_1.__importDefault(require("proxy"));
const shared_1 = require("./shared");
class MockProxy {
    initialize() {
        return new Promise(res => {
            this.server = (0, proxy_1.default)((0, http_1.createServer)());
            this.server.listen(0, () => res((0, shared_1.getPort)(this.server)));
        });
    }
    terminate() {
        return (0, shared_1.terminateServer)(this.server);
    }
}
exports.MockProxy = MockProxy;
//# sourceMappingURL=mock-proxy.js.map