Created
March 28, 2014 00:05
-
-
Save ivanvanderbyl/9821989 to your computer and use it in GitHub Desktop.
SSL static file server
This file contains 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 ( | |
"log" | |
"net/http" | |
) | |
func main() { | |
http.Handle("/versions/", http.StripPrefix("/versions/", http.FileServer(http.Dir("/tmp")))) | |
log.Printf("About to listen on 10443. Go to https://127.0.0.1:10443/") | |
err := http.ListenAndServeTLS(":10443", "cert.pem", "key.pem", nil) | |
if err != nil { | |
log.Fatal(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment