mirror of
https://github.com/coder/code-server.git
synced 2024-12-25 18:52: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).
|
* ensuring there is one (will throw if there isn't).
|
||||||
*/
|
*/
|
||||||
export const ensureAddress = (server: http.Server): string => {
|
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")
|
throw new Error("server has no address")
|
||||||
}
|
}
|
||||||
if (typeof addr !== "string") {
|
if (typeof addr !== "string") {
|
||||||
return `${addr.address}:${addr.port}`
|
return `http://${addr.address}:${addr.port}`
|
||||||
}
|
}
|
||||||
return addr
|
return addr
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ const main = async (args: DefaultedArgs): Promise<void> => {
|
|||||||
|
|
||||||
if (args.link) {
|
if (args.link) {
|
||||||
try {
|
try {
|
||||||
await coderCloudBind(serverAddress, args.link.value)
|
await coderCloudBind(serverAddress.replace(/^https?:\/\//, ""), args.link.value)
|
||||||
logger.info(" - Connected to cloud agent")
|
logger.info(" - Connected to cloud agent")
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error(err.message)
|
logger.error(err.message)
|
||||||
|
Loading…
Reference in New Issue
Block a user