update JetBrains License Server

master
ehlxr 2018-01-22 18:14:27 +08:00
parent 379c8cdb7b
commit 416fa4f88d
9 changed files with 18 additions and 15 deletions

View File

@ -1,4 +1,4 @@
package common
package ip
import (
"bytes"

View File

@ -1,4 +1,4 @@
package common
package ip
import (
"fmt"

View File

@ -1,4 +1,4 @@
package common
package logger
import (
"io"

View File

@ -1,4 +1,4 @@
package common
package pool
import (
"errors"

View File

@ -1,4 +1,4 @@
package common
package pool
import (
"io"

View File

@ -1,4 +1,4 @@
package common
package runner
import (
"errors"

View File

@ -1,4 +1,4 @@
package common
package runner
import (
"log"

View File

@ -1,4 +1,4 @@
package common
package sync
import (
"sync"

View File

@ -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")