mirror of
https://github.com/coder/code-server.git
synced 2024-12-25 02:33:34 +03:00
Include protocol on printed address
This makes it clickable from the terminal.
This commit is contained in:
parent
e2c35facdb
commit
a653b93ce2
@ -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
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ const main = async (args: DefaultedArgs): Promise<void> => {
|
||||
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user