mirror of
https://github.com/astaxie/beego.git
synced 2024-12-23 00:50:51 +00:00
support unix socket fix #151
You can set HttpAddr="/tmp/beego.sock" HttpPort=0
This commit is contained in:
parent
4f538e7fd2
commit
3cb8a96041
7
beego.go
7
beego.go
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user