INNER CODE UNIT · Go

openWhenReady

casosorg/casos · main.go:295

func openWhenReady(port int) {
	webURL := fmt.Sprintf("http://localhost:%d/", port)

	if err := util.WaitForServer(webURL, startupTimeout); err != nil {
		logs.Warning("startup: %v", err)
		util.ReportStartupFailure(fmt.Sprintf(
			"CasOS did not finish starting within %s.\n\n"+
				"The CasOS console window shows what went wrong. The most common "+
				"cause is port %d already being in use by another program — change "+
				"httpport in conf/app.conf to use a different one.",
			startupTimeout, port))
		return
	}

	logs.Info("casos ready — opening %s", webURL)
	if err := util.OpenBrowser(webURL); err != nil {
		logs.Warning("open browser: %v", err)
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…