func OpenBrowser(url string) { Expand Down Expand Up @@ -139,3 +141,23 @@ func Max(a int, b int) int { return b } } func GetRandomString(length int) string { rand.Seed(time.Now().UnixNano()) key := make([]byte, length) for i := 0; i < length; i++ { key[i] = ...
( + "fmt" + "github.com/google/uuid" + "html/template" + "log" + "net" + "os/exec" + "runtime" + "strconv" + "strings" +) + +func OpenBrowser(url string) { + var err error + + switch runtime.GOOS { + case "linux": + err = exec.Command("xdg-open", url).Start...
fmt.Println("Usage: coze-discord-proxy [--port <port>] [--log-dir <log directory>] [--version] [--help]") } func init() { Expand All @@ -38,12 +38,6 @@ func init() { os.Exit(0) } if os.Getenv("SESSION_SECRET") != "" { SessionSecret = os.Getenv("SESSION_SECRET"...
func OpenBrowser(url string) { Expand Down Expand Up @@ -139,3 +141,23 @@ func Max(a int, b int) int { return b } } func GetRandomString(length int) string { rand.Seed(time.Now().UnixNano()) key := make([]byte, length) for i := 0; i < length; i++ { key[i] = ...