|
@@ -11,6 +11,7 @@ import (
|
|
func main() {
|
|
func main() {
|
|
serverPort := 12345
|
|
serverPort := 12345
|
|
path := ""
|
|
path := ""
|
|
|
|
+ reverseHost := ""
|
|
if len(os.Args) > 1 {
|
|
if len(os.Args) > 1 {
|
|
for k, v := range os.Args {
|
|
for k, v := range os.Args {
|
|
if k == 0 {
|
|
if k == 0 {
|
|
@@ -20,6 +21,11 @@ func main() {
|
|
hasPortL := strings.HasPrefix(arg, "--port=")
|
|
hasPortL := strings.HasPrefix(arg, "--port=")
|
|
hasPortS := strings.HasPrefix(arg, "-p=")
|
|
hasPortS := strings.HasPrefix(arg, "-p=")
|
|
hasPath := strings.HasPrefix(arg, "--path=")
|
|
hasPath := strings.HasPrefix(arg, "--path=")
|
|
|
|
+
|
|
|
|
+ if strings.HasPrefix(arg, "--host=") {
|
|
|
|
+ reverseHost = strings.TrimPrefix(arg, "--host=")
|
|
|
|
+ }
|
|
|
|
+
|
|
if hasPortL {
|
|
if hasPortL {
|
|
i, err := strconv.ParseInt(strings.ReplaceAll(arg, "--port=", ""), 10, 32)
|
|
i, err := strconv.ParseInt(strings.ReplaceAll(arg, "--port=", ""), 10, 32)
|
|
if err == nil {
|
|
if err == nil {
|
|
@@ -47,7 +53,7 @@ func main() {
|
|
path = fmt.Sprintf("/%s", path)
|
|
path = fmt.Sprintf("/%s", path)
|
|
}
|
|
}
|
|
|
|
|
|
- http.HandleFunc(path, indexHandler)
|
|
+ http.HandleFunc(fmt.Sprintf("%s/", path), createIndexHandler(reverseHost))
|
|
http.HandleFunc(fmt.Sprintf("%s/jrebel/leases", path), jrebelLeasesHandler)
|
|
http.HandleFunc(fmt.Sprintf("%s/jrebel/leases", path), jrebelLeasesHandler)
|
|
http.HandleFunc(fmt.Sprintf("%s/jrebel/leases/1", path), jrebelLeases1Handler)
|
|
http.HandleFunc(fmt.Sprintf("%s/jrebel/leases/1", path), jrebelLeases1Handler)
|
|
http.HandleFunc(fmt.Sprintf("%s/agent/leases", path), jrebelLeasesHandler)
|
|
http.HandleFunc(fmt.Sprintf("%s/agent/leases", path), jrebelLeasesHandler)
|