1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 18:50:54 +00:00

support unix socket fix #151

You can set
HttpAddr="/tmp/beego.sock"
HttpPort=0
This commit is contained in:
astaxie 2013-08-19 11:21:02 +08:00
parent 4f538e7fd2
commit 3cb8a96041

View File

@ -98,7 +98,11 @@ func NewApp() *App {
}
func (app *App) Run() {
addr := fmt.Sprintf("%s:%d", HttpAddr, HttpPort)
addr := HttpAddr
if HttpPort != 0 {
addr = fmt.Sprintf("%s:%d", HttpAddr, HttpPort)
}
var (
err error
l net.Listener
@ -134,7 +138,6 @@ func (app *App) Run() {
}
err = s.ListenAndServe()
}
}
if err != nil {
BeeLogger.Fatal("ListenAndServe: ", err)