Created
June 5, 2017 07:43
-
-
Save odeke-em/30007ca77d4e025109a48d505456de05 to your computer and use it in GitHub Desktop.
HTTPS-ify darksi.de with frontender: generate a binary that could be uploaded directly to cloud storage then pulled and deployed on server
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 ( | |
"io" | |
"log" | |
"os" | |
"github.com/orijtech/frontender" | |
) | |
func main() { | |
rc, err := frontender.GenerateBinary(&frontender.DeployInfo{ | |
FrontendConfig: &frontender.Request{ | |
Domains: []string{ | |
"http://darksi.de/", | |
}, | |
ProxyAddress: "http://192.168.1.105:9884", | |
}, | |
TargetGOOS: "linux", | |
Environ: []string{"CGO_ENABLED=0"}, | |
}) | |
if err != nil { | |
log.Fatal(err) | |
} | |
defer rc.Close() | |
f, err := os.Create("darksi.de-binary") | |
if err != nil { | |
log.Fatal(err) | |
} | |
defer f.Close() | |
io.Copy(f, rc) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment