"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Object.defineProperty(exports, "__esModule", { value: true });
exports.PortRelayConnectResponseMessage = void 0;
const dev_tunnels_ssh_1 = require("@microsoft/dev-tunnels-ssh");
/**
 * Extends port-forward channel open confirmation messages to include additional properties
 * required by the tunnel relay.
 */
class PortRelayConnectResponseMessage extends dev_tunnels_ssh_1.ChannelOpenConfirmationMessage {
    constructor() {
        super(...arguments);
        /**
         * Gets or sets a value indicating whether end-to-end encryption is enabled for the
         * connection.
         * The tunnel client may request E2E encryption via `isE2EEncryptionRequested`. Then relay
         * or host may enable E2E encryption or not depending on capabilities and policies, and the
         * resulting enabled status is returned to the client via this property.
         */
        this.isE2EEncryptionEnabled = false;
    }
    onWrite(writer) {
        super.onWrite(writer);
        writer.writeBoolean(this.isE2EEncryptionEnabled);
    }
    onRead(reader) {
        super.onRead(reader);
        this.isE2EEncryptionEnabled = reader.readBoolean();
    }
}
exports.PortRelayConnectResponseMessage = PortRelayConnectResponseMessage;
//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/8761a5560cfd65fdd19ce7e2bd18dab5c0a4d84e/node_modules/@microsoft/dev-tunnels-connections/messages/portRelayConnectResponseMessage.js.map