Last active
July 10, 2020 14:04
-
-
Save Sammuel09/008cbb63d88d4c4f5ac9fa9ce85c807c to your computer and use it in GitHub Desktop.
This is a reverse-proxy server for statement backend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
) | |
func main() { | |
mux := http.NewServeMux() | |
mux.Handle("/", httputil.NewSingleHostReverseProxy(&url.URL{ | |
Scheme: "http", | |
Host: "localhost:3002", // if the service is running on localhost:3000 | |
})) | |
fmt.Printf("listening on https://statement.samuel.dev.brank.as:9443") | |
http.ListenAndServeTLS("localhost:9443", "samuel.dev.brank.as+5.pem", "samuel.dev.brank.as+5-key.pem", mux) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the
.pem files
are the certificate files. Any valid certificate you generate should suffice, just make sure it matches. Also, save the.pem files
in the same folder as the main.go file