Exit on permission denied
This commit is contained in:
parent
f37349fff7
commit
cffa74f9cf
3 changed files with 24 additions and 4 deletions
17
traefik.go
17
traefik.go
|
@ -21,6 +21,7 @@ import (
|
|||
"time"
|
||||
fmtlog "log"
|
||||
"github.com/mailgun/oxy/cbreaker"
|
||||
"net"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -168,9 +169,21 @@ func main() {
|
|||
|
||||
go func() {
|
||||
if len(gloablConfiguration.CertFile) > 0 && len(gloablConfiguration.KeyFile) > 0 {
|
||||
srv.ListenAndServeTLS(gloablConfiguration.CertFile, gloablConfiguration.KeyFile)
|
||||
err := srv.ListenAndServeTLS(gloablConfiguration.CertFile, gloablConfiguration.KeyFile)
|
||||
if (err!= nil ){
|
||||
netOpError, ok := err.(*net.OpError)
|
||||
if ok && netOpError.Err.Error() != "use of closed network connection" {
|
||||
log.Fatal("Error creating server: ", err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
srv.ListenAndServe()
|
||||
err := srv.ListenAndServe()
|
||||
if (err!= nil ){
|
||||
netOpError, ok := err.(*net.OpError)
|
||||
if ok && netOpError.Err.Error() != "use of closed network connection" {
|
||||
log.Fatal("Error creating server: ", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
log.Notice("Started")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue