Thanks. how about the sample of general socket listener with SSL rather
than net/http implementation?
Regards
Dimas Prawira wrote:
Here is an example running server with TLS
package main
import (
"net/http"
"log"
)
func HelloServer(w http.ResponseWriter,req *http.Request) {
w.Header().Set("Content-Type","text/plain")
w.Write([]byte("This is an example server.\n"))
}
func main() {
http.HandleFunc("/hello",HelloServer)
err := http.ListenAndServeTLS(":443","server.crt","server.key",nil)
if err != nil {
log.Fatal("ListenAndServe: ",err)
}
}
--
Wesley Peng
wesleyp...@aol.com
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/ffdb0882-3e1a-173d-6c3c-91f63d88bbfe%40aol.com.