|
|
@ -75,7 +75,7 @@ func SetupReverseProxy(local_port int, target string) { |
|
|
|
|
|
|
|
|
fmt.Printf("Listening on port %v for incoming requests...\n", local_port) |
|
|
fmt.Printf("Listening on port %v for incoming requests...\n", local_port) |
|
|
err = http.ListenAndServe(fmt.Sprintf(":%v", local_port), handler) |
|
|
err = http.ListenAndServe(fmt.Sprintf(":%v", local_port), handler) |
|
|
if (err != nil) { |
|
|
if err != nil { |
|
|
fmt.Println("ERROR: %s", err) |
|
|
fmt.Println("ERROR: %s", err) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -85,13 +85,13 @@ func main() { |
|
|
backend_endpoint := os.Getenv("BACKEND_ENDPOINT_OVERRIDE") |
|
|
backend_endpoint := os.Getenv("BACKEND_ENDPOINT_OVERRIDE") |
|
|
|
|
|
|
|
|
portal_port_opt := os.Getenv("PORTAL_LISTEN_PORT") |
|
|
portal_port_opt := os.Getenv("PORTAL_LISTEN_PORT") |
|
|
if (portal_port_opt == "") { |
|
|
if portal_port_opt == "" { |
|
|
portal_port_opt = "9090" |
|
|
portal_port_opt = "9090" |
|
|
fmt.Println("WARNING: No PORTAL_LISTEN_PORT environment variable found, defaulting to '9090'...") |
|
|
fmt.Println("WARNING: No PORTAL_LISTEN_PORT environment variable found, defaulting to '9090'...") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
backend_port_opt := os.Getenv("BACKEND_LISTEN_PORT") |
|
|
backend_port_opt := os.Getenv("BACKEND_LISTEN_PORT") |
|
|
if (backend_port_opt == "") { |
|
|
if backend_port_opt == "" { |
|
|
backend_port_opt = "9091" |
|
|
backend_port_opt = "9091" |
|
|
fmt.Println("WARNING: No BACKEND_LISTEN_PORT environment variable found, defaulting to '9091'...") |
|
|
fmt.Println("WARNING: No BACKEND_LISTEN_PORT environment variable found, defaulting to '9091'...") |
|
|
} |
|
|
} |
|
|
@ -106,12 +106,12 @@ func main() { |
|
|
error = true |
|
|
error = true |
|
|
} |
|
|
} |
|
|
portal_port, err := strconv.Atoi(portal_port_opt) |
|
|
portal_port, err := strconv.Atoi(portal_port_opt) |
|
|
if (err != nil) { |
|
|
if err != nil { |
|
|
fmt.Printf("ERROR: Cannot parse the PORTAL_LISTEN_PORT environment variable (%s): %s\n", portal_port_opt, err) |
|
|
fmt.Printf("ERROR: Cannot parse the PORTAL_LISTEN_PORT environment variable (%s): %s\n", portal_port_opt, err) |
|
|
error = true |
|
|
error = true |
|
|
} |
|
|
} |
|
|
backend_port, err := strconv.Atoi(backend_port_opt) |
|
|
backend_port, err := strconv.Atoi(backend_port_opt) |
|
|
if (err != nil) { |
|
|
if err != nil { |
|
|
fmt.Printf("ERROR: Cannot parse the BACKEND_LISTEN_PORT environment variable (%s): %s\n", backend_port_opt, err) |
|
|
fmt.Printf("ERROR: Cannot parse the BACKEND_LISTEN_PORT environment variable (%s): %s\n", backend_port_opt, err) |
|
|
error = true |
|
|
error = true |
|
|
} |
|
|
} |
|
|
|