Compare commits
No commits in common. "6b42c2400fbdf7a94b2cfbbd2c971b06b7d5489d" and "603d7c4e14b7dbed41097f745837140d0dafdafd" have entirely different histories.
6b42c2400f
...
603d7c4e14
|
@ -14,7 +14,6 @@ export interface DataSocketOptions {
|
|||
onreceive?: OnReceive;
|
||||
onsend?: OnSend;
|
||||
onclose?: OnClose;
|
||||
emulateWebsocket?: boolean;
|
||||
}
|
||||
export interface PeerOptions {
|
||||
peer: any;
|
||||
|
@ -32,7 +31,6 @@ export default class Peer {
|
|||
private _onreceive;
|
||||
private _onsend;
|
||||
private _onclose;
|
||||
private _emulateWebsocket;
|
||||
constructor({ proxy, peer, muxer, onopen, onreceive, onsend, onclose, emulateWebsocket, }: PeerOptionsWithProxy & DataSocketOptions);
|
||||
constructor({ proxy, peer, muxer, onopen, onreceive, onsend, onclose, }: PeerOptionsWithProxy & DataSocketOptions);
|
||||
init(): Promise<void>;
|
||||
}
|
||||
|
|
|
@ -14,8 +14,7 @@ class Peer {
|
|||
_onreceive;
|
||||
_onsend;
|
||||
_onclose;
|
||||
_emulateWebsocket;
|
||||
constructor({ proxy, peer, muxer, onopen, onreceive, onsend, onclose, emulateWebsocket = false, }) {
|
||||
constructor({ proxy, peer, muxer, onopen, onreceive, onsend, onclose, }) {
|
||||
this._proxy = proxy;
|
||||
this._peer = peer;
|
||||
this._muxer = muxer;
|
||||
|
@ -23,7 +22,6 @@ class Peer {
|
|||
this._onreceive = onreceive;
|
||||
this._onsend = onsend;
|
||||
this._onclose = onclose;
|
||||
this._emulateWebsocket = emulateWebsocket;
|
||||
}
|
||||
async init() {
|
||||
const write = async (data, cb) => {
|
||||
|
@ -46,7 +44,6 @@ class Peer {
|
|||
remotePort: self._peer.rawStream.remotePort,
|
||||
remotePublicKey: self._peer.remotePublicKey,
|
||||
write,
|
||||
emulateWebsocket: self._emulateWebsocket,
|
||||
});
|
||||
self._socket.on("end", () => channel.close());
|
||||
let ret = await self._onopen?.(self._socket, m);
|
||||
|
|
|
@ -19,7 +19,6 @@ export interface DataSocketOptions {
|
|||
onreceive?: OnReceive;
|
||||
onsend?: OnSend;
|
||||
onclose?: OnClose;
|
||||
emulateWebsocket?: boolean;
|
||||
}
|
||||
|
||||
export interface PeerOptions {
|
||||
|
@ -40,7 +39,6 @@ export default class Peer {
|
|||
private _onreceive: OnReceive;
|
||||
private _onsend: OnSend;
|
||||
private _onclose: OnClose;
|
||||
private _emulateWebsocket: boolean;
|
||||
|
||||
constructor({
|
||||
proxy,
|
||||
|
@ -50,7 +48,6 @@ export default class Peer {
|
|||
onreceive,
|
||||
onsend,
|
||||
onclose,
|
||||
emulateWebsocket = false,
|
||||
}: PeerOptionsWithProxy & DataSocketOptions) {
|
||||
this._proxy = proxy;
|
||||
this._peer = peer;
|
||||
|
@ -59,7 +56,6 @@ export default class Peer {
|
|||
this._onreceive = onreceive;
|
||||
this._onsend = onsend;
|
||||
this._onclose = onclose;
|
||||
this._emulateWebsocket = emulateWebsocket;
|
||||
}
|
||||
|
||||
async init() {
|
||||
|
@ -84,7 +80,6 @@ export default class Peer {
|
|||
remotePort: self._peer.rawStream.remotePort,
|
||||
remotePublicKey: self._peer.remotePublicKey,
|
||||
write,
|
||||
emulateWebsocket: self._emulateWebsocket,
|
||||
});
|
||||
self._socket.on("end", () => channel.close());
|
||||
let ret = await self._onopen?.(self._socket, m);
|
||||
|
|
Loading…
Reference in New Issue