Golang net/http.Server.ListenAndServeTLS() function example
package net/http
Golang net/http.Server.ListenAndServeTLS() function usage example
Code modified from https://www.socketloop.com/references/golang-net-http-server-listenandserve-function-and-server-type-example
TLSServer := &http.Server{Handler: mux}
TLSServer.Addr = "hostname:443"
err := TLSServer.ListenAndServeTLS("server.pem", "server.key")
See also : https://www.socketloop.com/references/golang-crypto-tls-listen-and-newlistener-functions-example
References :
See also : Golang net/http.Server.ListenAndServe() function and Server type example
Advertisement
Something interesting
Tutorials
+24.1k Golang : Upload to S3 with official aws-sdk-go package
+9.7k Golang : Sort and reverse sort a slice of floats
+12.3k Golang : 2 dimensional array example
+10.6k Golang : Select region of interest with mouse click and crop from image
+7.4k Golang : Accessing dataframe-go element by row, column and name example
+8.1k Golang : Variadic function arguments sanity check example
+25.8k Golang : Daemonizing a simple web server process example
+17.5k Golang : Clone with pointer and modify value
+8.1k Golang : Randomize letters from a string example
+29.4k Golang : JQuery AJAX post data to server and send data back to client example
+8.2k Golang : Get final or effective URL with Request.URL example
+16.8k Golang : read gzipped http response