libhyperproxy/dist/proxies/multiSocket/peer.js

21 lines
665 B
JavaScript
Raw Normal View History

2023-04-16 02:17:57 +00:00
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const peer_js_1 = __importDefault(require("../../peer.js"));
class Peer extends peer_js_1.default {
async initSocket() { }
2023-04-16 07:06:53 +00:00
get stream() {
return this._muxer.stream;
}
2023-04-16 02:17:57 +00:00
async handleChannelOnClose(socket) {
return this._proxy.handleClosePeer(this);
}
async handleChannelOnOpen(m) {
2023-04-16 07:06:53 +00:00
await this._proxy.handleNewPeerChannel(this);
2023-04-16 10:08:50 +00:00
this._proxy.emit("peerOpen", this);
2023-04-16 02:17:57 +00:00
}
}
exports.default = Peer;