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

CodingPapi picture CodingPapi  路  3Comments

nxvl picture nxvl  路  3Comments

wangcn picture wangcn  路  3Comments

frederikhors picture frederikhors  路  3Comments

rawoke083 picture rawoke083  路  3Comments