Gin: How to serve same content from HTTP and HTTPS with same router?

Created on 20 Jun 2016  路  1Comment  路  Source: gin-gonic/gin

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()
question

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

colortell picture colortell  路  19Comments

libnat picture libnat  路  29Comments

dcu picture dcu  路  30Comments

miketonks picture miketonks  路  25Comments

TaceyWong picture TaceyWong  路  24Comments