Guest User

Untitled

a guest
Nov 9th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. appname = myproject
  2. runmode = prod
  3. [dev]
  4. httpaddr = "127.0.0.1"
  5. HTTPPort = 9100
  6. [prod]
  7. httpaddr = "127.0.0.1"
  8. HTTPSPort = 9099
  9. httpsaddr = "127.0.0.1"
  10. EnableHTTPS = true
  11. EnableHttpTLS = true
  12. HTTPSCertFile = "googleapis.cer"
  13. HTTPSKeyFile = "googleapis.key"
  14. [test]
  15. HTTPSPort = 9099
  16.  
  17. 2018/11/09 10:07:56.251 [I] [asm_amd64.s:2361] http server Running on http://127.0.0.1:8080
  18. 2018/11/09 10:07:56.253 [I] [asm_amd64.s:2361] https server Running on https://127.0.0.1:9099
  19. 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.
  20.  
  21. if BConfig.Listen.EnableHTTPS || BConfig.Listen.EnableMutualHTTPS {
  22. go func() {
  23. //...
  24. app.Server.Addr = // the Addr is set to the value of HTTPS addr
  25. // ListenAndServeTLS()
  26. }()
  27. }
  28. if BConfig.Listen.EnableHTTP {
  29. go func() {
  30. app.Server.Addr = addr // the Addr is set to the valu of HTTP addr
  31. // ListenAndServe()
  32. }()
  33. }
  34.  
  35. EnableHTTP = false
  36. EnableHTTPS = true
Add Comment
Please, Sign In to add comment