1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-23 04:00:56 +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() { func (app *App) Run() {
addr := fmt.Sprintf("%s:%d", HttpAddr, HttpPort) addr := HttpAddr
if HttpPort != 0 {
addr = fmt.Sprintf("%s:%d", HttpAddr, HttpPort)
}
var ( var (
err error err error
l net.Listener l net.Listener
@ -134,7 +138,6 @@ func (app *App) Run() {
} }
err = s.ListenAndServe() err = s.ListenAndServe()
} }
} }
if err != nil { if err != nil {
BeeLogger.Fatal("ListenAndServe: ", err) BeeLogger.Fatal("ListenAndServe: ", err)