From a653b93ce210e1e160fbe906a777d77ca5b893bb Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 3 Nov 2020 16:11:28 -0600 Subject: [PATCH] Include protocol on printed address This makes it clickable from the terminal. --- src/node/app.ts | 4 ++-- src/node/entry.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node/app.ts b/src/node/app.ts index 5fde2767..171a7c4d 100644 --- a/src/node/app.ts +++ b/src/node/app.ts @@ -45,7 +45,7 @@ export const createApp = async (args: DefaultedArgs): Promise<[Express, http.Ser } /** - * Get the address of a server as a string (protocol not included) while + * Get the address of a server as a string (protocol *is* included) while * ensuring there is one (will throw if there isn't). */ export const ensureAddress = (server: http.Server): string => { @@ -54,7 +54,7 @@ export const ensureAddress = (server: http.Server): string => { throw new Error("server has no address") } if (typeof addr !== "string") { - return `${addr.address}:${addr.port}` + return `http://${addr.address}:${addr.port}` } return addr } diff --git a/src/node/entry.ts b/src/node/entry.ts index 82e04f5d..3cca62a5 100644 --- a/src/node/entry.ts +++ b/src/node/entry.ts @@ -141,7 +141,7 @@ const main = async (args: DefaultedArgs): Promise => { if (args.link) { try { - await coderCloudBind(serverAddress, args.link.value) + await coderCloudBind(serverAddress.replace(/^https?:\/\//, ""), args.link.value) logger.info(" - Connected to cloud agent") } catch (err) { logger.error(err.message)