1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-10 21:45:57 +00:00

Set the default hostname to "0.0.0.0" from "127.0.0.1" - as golang's net.Listener does by default

I changed that because some guys has problems in their hosting machines,
and they should use the "127.0..0.1" instead of "0.0.0.0", if you have
problems just pass `iris.Listen("127.0.0.1:8080") instead of
`iris.Listen(":8080")`
This commit is contained in:
Gerasimos Maropoulos
2016-07-21 00:03:36 +03:00
parent 352b297977
commit 0dbab32d9d
4 changed files with 11 additions and 6 deletions

View File

@@ -1309,7 +1309,7 @@ type (
api *muxAPI
errorHandlers map[int]Handler
logger *logger.Logger
// the main server host's name, ex: localhost, 127.0.0.1, iris-go.com
// the main server host's name, ex: localhost, 127.0.0.1, 0.0.0.0, iris-go.com
hostname string
// if any of the trees contains not empty subdomain
hosts bool
@@ -1328,7 +1328,7 @@ func newServeMux(contextPool sync.Pool, logger *logger.Logger) *serveMux {
cPool: &contextPool,
lookups: make([]*route, 0),
errorHandlers: make(map[int]Handler, 0),
hostname: "127.0.0.1",
hostname: config.DefaultServerHostname, // these are changing when the server is up
escapePath: !config.DefaultDisablePathEscape,
correctPath: !config.DefaultDisablePathCorrection,
logger: logger,