diff --git a/common/ip.go b/common/ip/ip.go similarity index 99% rename from common/ip.go rename to common/ip/ip.go index 5e84450..ebf134e 100644 --- a/common/ip.go +++ b/common/ip/ip.go @@ -1,4 +1,4 @@ -package common +package ip import ( "bytes" diff --git a/common/ip_test.go b/common/ip/ip_test.go similarity index 99% rename from common/ip_test.go rename to common/ip/ip_test.go index 2f2c2f0..f4a70d6 100644 --- a/common/ip_test.go +++ b/common/ip/ip_test.go @@ -1,4 +1,4 @@ -package common +package ip import ( "fmt" diff --git a/common/log_test.go b/common/logger/log_test.go similarity index 98% rename from common/log_test.go rename to common/logger/log_test.go index 0be3b15..456ffd7 100644 --- a/common/log_test.go +++ b/common/logger/log_test.go @@ -1,4 +1,4 @@ -package common +package logger import ( "io" diff --git a/common/pool.go b/common/pool/pool.go similarity index 99% rename from common/pool.go rename to common/pool/pool.go index 707c3df..36603df 100644 --- a/common/pool.go +++ b/common/pool/pool.go @@ -1,4 +1,4 @@ -package common +package pool import ( "errors" diff --git a/common/pool_test.go b/common/pool/pool_test.go similarity index 98% rename from common/pool_test.go rename to common/pool/pool_test.go index cfa35e5..302ecb6 100644 --- a/common/pool_test.go +++ b/common/pool/pool_test.go @@ -1,4 +1,4 @@ -package common +package pool import ( "io" diff --git a/common/runner.go b/common/runner/runner.go similarity index 99% rename from common/runner.go rename to common/runner/runner.go index 21bbe9b..a74793b 100644 --- a/common/runner.go +++ b/common/runner/runner.go @@ -1,4 +1,4 @@ -package common +package runner import ( "errors" diff --git a/common/runner_test.go b/common/runner/runner_test.go similarity index 97% rename from common/runner_test.go rename to common/runner/runner_test.go index 786cc3b..8259dc5 100644 --- a/common/runner_test.go +++ b/common/runner/runner_test.go @@ -1,4 +1,4 @@ -package common +package runner import ( "log" diff --git a/common/sync_map.go b/common/sync/sync_map.go similarity index 98% rename from common/sync_map.go rename to common/sync/sync_map.go index b4072cc..acf952f 100644 --- a/common/sync_map.go +++ b/common/sync/sync_map.go @@ -1,4 +1,4 @@ -package common +package sync import ( "sync" diff --git a/utils/idea/main.go b/utils/idea/main.go index cbb36de..fc0abe1 100755 --- a/utils/idea/main.go +++ b/utils/idea/main.go @@ -20,20 +20,23 @@ import ( func main() { log.SetOutput(os.Stdout) + log.Println("************************************************************") + log.Printf("** %-55s**", "JetBrains License Server") + log.Printf("** %-55s**", "Please support genuine!!!") + port := flag.Int("p", 21017, "port") host := flag.String("h", "0.0.0.0", "Bind TCP Address") flag.Parse() + log.Printf("** listen on %-45s**", fmt.Sprintf("%s:%d...", *host, *port)) + addr := fmt.Sprintf("%s:%d", *host, *port) if strings.Contains(addr, "0.0.0.0") { - addr = strings.Replace(addr, "0.0.0.0", "127.0.0.1", 1) + addr = strings.Replace(addr, "0.0.0.0", "", 1) + *host = strings.Replace(*host, "0.0.0.0", "127.0.0.1", 1) } - log.Println("************************************************************") - log.Printf("** %-55s**", "JetBrains License Server") - log.Printf("** %-55s**", "Please support genuine!!!") - log.Printf("** listen on %-45s**", fmt.Sprintf("%s:%d...", *host, *port)) - log.Printf("** You can use %-43s**", fmt.Sprintf("http://%s as license server", addr)) + log.Printf("** You can use %-43s**", fmt.Sprintf("http://%s:%d as license server", *host, *port)) log.Println("************************************************************") routerBinding() @@ -75,7 +78,7 @@ func ping(w http.ResponseWriter, r *http.Request) { } func obtainTicket(w http.ResponseWriter, r *http.Request) { - log.Println(r.URL) + // log.Println(r.URL) //buildDate := r.URL.Query().Get("buildDate") //clientVersion := r.URL.Query().Get("clientVersion") //hostName := r.URL.Query().Get("hostName")