*As a kernel-based protomux may be used, need to await on createChannel and addMessage
This commit is contained in:
parent
8e0edc4bcd
commit
92245a6c1c
|
@ -115,7 +115,7 @@ export default class Peer {
|
||||||
emulateWebsocket: self._emulateWebsocket,
|
emulateWebsocket: self._emulateWebsocket,
|
||||||
});
|
});
|
||||||
|
|
||||||
this._channel = this._muxer.createChannel({
|
this._channel = await this._muxer.createChannel({
|
||||||
protocol: this._proxy.protocol,
|
protocol: this._proxy.protocol,
|
||||||
async onopen(m: any) {
|
async onopen(m: any) {
|
||||||
if (!m) {
|
if (!m) {
|
||||||
|
@ -142,7 +142,7 @@ export default class Peer {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this._createDefaultMessage) {
|
if (this._createDefaultMessage) {
|
||||||
pipe = this._channel.addMessage({
|
pipe = await this._channel.addMessage({
|
||||||
async onmessage(m: any) {
|
async onmessage(m: any) {
|
||||||
if (m instanceof Uint8Array) {
|
if (m instanceof Uint8Array) {
|
||||||
m = Buffer.from(m);
|
m = Buffer.from(m);
|
||||||
|
|
Loading…
Reference in New Issue