Compare commits
2 Commits
baf0ac31e6
...
b14509d6f1
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | b14509d6f1 | |
Derrick Hammer | b3a7c0b4e1 |
|
@ -42,7 +42,8 @@ export default class Peer {
|
|||
private _onsend;
|
||||
private _onclose;
|
||||
private _emulateWebsocket;
|
||||
private _channel?;
|
||||
constructor({ proxy, peer, muxer, onopen, onreceive, onsend, onclose, emulateWebsocket, }: PeerOptionsWithProxy & DataSocketOptions);
|
||||
private _channel?;
|
||||
get channel(): any;
|
||||
init(): Promise<void>;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ class Peer {
|
|||
_onsend;
|
||||
_onclose;
|
||||
_emulateWebsocket;
|
||||
_channel;
|
||||
constructor({ proxy, peer, muxer, onopen, onreceive, onsend, onclose, emulateWebsocket = false, }) {
|
||||
this._proxy = proxy;
|
||||
this._peer = peer;
|
||||
|
@ -26,6 +25,10 @@ class Peer {
|
|||
this._onclose = onclose?.bind(undefined, this);
|
||||
this._emulateWebsocket = emulateWebsocket;
|
||||
}
|
||||
_channel;
|
||||
get channel() {
|
||||
return this._channel;
|
||||
}
|
||||
async init() {
|
||||
const write = async (data, cb) => {
|
||||
pipe.send(data);
|
||||
|
|
|
@ -56,8 +56,6 @@ export default class Peer {
|
|||
private _onclose: OnCloseBound;
|
||||
private _emulateWebsocket: boolean;
|
||||
|
||||
private _channel?: any;
|
||||
|
||||
constructor({
|
||||
proxy,
|
||||
peer,
|
||||
|
@ -78,6 +76,12 @@ export default class Peer {
|
|||
this._emulateWebsocket = emulateWebsocket;
|
||||
}
|
||||
|
||||
private _channel?: any;
|
||||
|
||||
get channel(): any {
|
||||
return this._channel;
|
||||
}
|
||||
|
||||
async init() {
|
||||
const write = async (data: any, cb: Function) => {
|
||||
pipe.send(data);
|
||||
|
|
Loading…
Reference in New Issue