Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "log"
- "net/http"
- "runtime"
- )
- func handler(w http.ResponseWriter, req *http.Request) {
- w.Header().Set("Content-Type", "text/plain")
- w.Write([]byte("This is an example server.\n"))
- }
- func main() {
- runtime.GOMAXPROCS(runtime.NumCPU())
- http.HandleFunc("/", handler)
- log.Printf("About to listen on 8082. Go to https://127.0.0.1:8082/")
- err := http.ListenAndServeTLS(":8082", "cert.pem", "key.pem", nil)
- if err != nil {
- log.Fatal(err)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement