Handle custom httpd port

We only supported fetching the default httpd port (8080).
This commit removes navigation to `radicle.local` which represents
`0.0.0.0:8080`, and prepares the app for defining custom port.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
Sebastian Martinez
2023-06-14 16:17:21 +02:00
parent 4fcb7373a3
commit 52cece4680
11 changed files with 186 additions and 36 deletions
+22
View File
@@ -115,6 +115,28 @@ export class HttpdClient {
this.session = new session.Client(this.#fetcher);
}
public changePort(port: number): void {
this.#baseUrl.port = port;
}
public get url(): string {
return `${this.#baseUrl.scheme}://${this.#baseUrl.hostname}:${
this.#baseUrl.port
}`;
}
public get hostnamePort(): string {
return `${this.#baseUrl.hostname}:${this.#baseUrl.port}`;
}
public get hostname(): string {
return this.#baseUrl.hostname;
}
public get port(): string {
return this.#baseUrl.port.toString();
}
public async getNodeInfo(options?: RequestOptions): Promise<NodeInfo> {
return this.#fetcher.fetchOk(
{