Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- appname = myproject
- runmode = prod
- [dev]
- httpaddr = "127.0.0.1"
- HTTPPort = 9100
- [prod]
- httpaddr = "127.0.0.1"
- HTTPSPort = 9099
- httpsaddr = "127.0.0.1"
- EnableHTTPS = true
- EnableHttpTLS = true
- HTTPSCertFile = "googleapis.cer"
- HTTPSKeyFile = "googleapis.key"
- [test]
- HTTPSPort = 9099
- 2018/11/09 10:07:56.251 [I] [asm_amd64.s:2361] http server Running on http://127.0.0.1:8080
- 2018/11/09 10:07:56.253 [I] [asm_amd64.s:2361] https server Running on https://127.0.0.1:9099
- 2018/11/09 10:07:56.293 [C] [asm_amd64.s:2361] ListenAndServeTLS: listen tcp 127.0.0.1:9099: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
- if BConfig.Listen.EnableHTTPS || BConfig.Listen.EnableMutualHTTPS {
- go func() {
- //...
- app.Server.Addr = // the Addr is set to the value of HTTPS addr
- // ListenAndServeTLS()
- }()
- }
- if BConfig.Listen.EnableHTTP {
- go func() {
- app.Server.Addr = addr // the Addr is set to the valu of HTTP addr
- // ListenAndServe()
- }()
- }
- EnableHTTP = false
- EnableHTTPS = true
Add Comment
Please, Sign In to add comment