Is it safe in terms of concurrency to serve the same Engine from HTTP and HTTPS ports?
r := gin.Default()
r.GET ...
r.RunTLS(...) // RunTLS and Run should run concurrently.
r.Run()
This has been discusses quite a few times now. For the most recent answer look at https://github.com/gin-gonic/gin/issues/643
But the general idea is that you need to start two separate listeners inside goroutines. Or ideally have nginx or other reverse proxy set up in front of your go app that handles ssl offloading.
Most helpful comment
This has been discusses quite a few times now. For the most recent answer look at https://github.com/gin-gonic/gin/issues/643
But the general idea is that you need to start two separate listeners inside goroutines. Or ideally have nginx or other reverse proxy set up in front of your go app that handles ssl offloading.