Skip to content

Instantly share code, notes, and snippets.

@jan4984
Created August 21, 2018 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jan4984/b147ad70fad8b00839e3d6129c85b336 to your computer and use it in GitHub Desktop.
Save jan4984/b147ad70fad8b00839e3d6129c85b336 to your computer and use it in GitHub Desktop.
simple proxy for LAN https
package main
import (
"net/http"
"net/http/httputil"
"net/url"
)
func main() {
rpURL, err := url.Parse("http://10.0.0.125:8080")
if err != nil {
panic(err)
}
err = http.ListenAndServeTLS(":8080", "cert.pem", "key.pem", httputil.NewSingleHostReverseProxy(rpURL))
if err != nil {
panic(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment