@microsoft/dev-tunnels-ssh-tcp
Version:
SSH TCP extensions library for Dev Tunnels
32 lines • 1.28 kB
JavaScript
;
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
Object.defineProperty(exports, "__esModule", { value: true });
exports.PortForwardRequestMessage = void 0;
const dev_tunnels_ssh_1 = require("@microsoft/dev-tunnels-ssh");
const portForwardingService_1 = require("../services/portForwardingService");
class PortForwardRequestMessage extends dev_tunnels_ssh_1.SessionRequestMessage {
constructor() {
super();
this.addressToBind = '';
this.port = 0;
this.requestType = portForwardingService_1.PortForwardingService.portForwardRequestType;
this.wantReply = true;
}
onRead(reader) {
super.onRead(reader);
this.addressToBind = reader.readString('ascii');
this.port = reader.readUInt32();
}
onWrite(writer) {
super.onWrite(writer);
writer.writeString(this.validateField(this.addressToBind, 'address'), 'ascii');
writer.writeUInt32(this.validateField(this.port, 'port'));
}
toString() {
return `${super.toString()} (addressToBind=${this.addressToBind} port=${this.port})`;
}
}
exports.PortForwardRequestMessage = PortForwardRequestMessage;
//# sourceMappingURL=portForwardRequestMessage.js.map