*Need to wrap DhtNode in a hyperswarm instance
This commit is contained in:
parent
17ca564f43
commit
af76d85983
13
src/index.ts
13
src/index.ts
|
@ -68,10 +68,13 @@ export default class HyperswarmWeb extends EventEmitter {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._activeRelay = new DhtNode(
|
this._activeRelay = new Hyperswarm({
|
||||||
new Stream(true, new WebSocket(connection)),
|
dht: new DhtNode(
|
||||||
this._options
|
new Stream(true, new WebSocket(connection)),
|
||||||
);
|
this._options
|
||||||
|
),
|
||||||
|
keyPair: this._options.keyPair,
|
||||||
|
});
|
||||||
|
|
||||||
this._activeRelay.on("close", () => {
|
this._activeRelay.on("close", () => {
|
||||||
this._activeRelay = undefined;
|
this._activeRelay = undefined;
|
||||||
|
@ -83,7 +86,7 @@ export default class HyperswarmWeb extends EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
this._processQueuedActions();
|
this._processQueuedActions();
|
||||||
await this._activeRelay.ready();
|
await this._activeRelay.dht.ready();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async isServerAvailable(connection: string): Promise<boolean> {
|
private async isServerAvailable(connection: string): Promise<boolean> {
|
||||||
|
|
Loading…
Reference in New Issue