Closed SedueRey closed 9 years ago
I suggest you get nginx to listen to https and proxy the request to gin.
Matej Kramny
On Monday, 23 February 2015 at 09:47, Eduardo Rey Jara wrote:
Hello, I'm planning to use gin to get an RESTFull API but I don't see how shoud I use Gin to listen HTTPS connections. Is there any tutorial or video or contrib I could see? Thanks,
— Reply to this email directly or view it on GitHub (https://github.com/gin-gonic/gin/issues/227).
Cool! Same code for both listeners... I'll try. Thanks!
Nginx is preffered for SSL termination, because it's about 3 times faster in terms of handshaking. And Nginx better handles slow clients. However it's not an option for some situations. For example portable apps or similar.
Here's how to do out-of-the box SSL with gin:
import "net/http"
err := http.ListenAndServeTLS(address, SSLCert, SSLPrivKey, ginRouter)
Nginx is preffered for SSL termination, because it's about 3 times faster in terms of handshaking. And Nginx better handles slow clients. However it's not an option for some situations. For example portable apps or similar.
Here's how to do out-of-the box SSL with gin:
import "net/http" err := http.ListenAndServeTLS(address, SSLCert, SSLPrivKey, ginRouter)
good
@jiguangin you can use RunTLS(address, SSLCert, SSLPrivKey)
Hello,
I'm planning to use gin to get an RESTFull API but I don't see how shoud I use Gin to listen HTTPS connections. Is there any tutorial or video or contrib I could see?
Thanks,