diff --git a/src/transports/base.ts b/src/transports/base.ts index c6fe575..1d982e7 100644 --- a/src/transports/base.ts +++ b/src/transports/base.ts @@ -11,7 +11,9 @@ export abstract class BasePeer implements Peer { constructor({ socket, uris = [] }: PeerConstructorOptions) { this.connectionUris = uris.map((uri) => new URL(uri.toString())); this.challenge = new Uint8Array(); - this._socket = socket; + if (socket) { + this._socket = socket; + } } private _id?: NodeId;