support unix socket fix #151
You can set HttpAddr="/tmp/beego.sock" HttpPort=0
Showing
1 changed file
with
5 additions
and
2 deletions
| ... | @@ -98,7 +98,11 @@ func NewApp() *App { | ... | @@ -98,7 +98,11 @@ func NewApp() *App { |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | func (app *App) Run() { | 100 | func (app *App) Run() { |
| 101 | addr := fmt.Sprintf("%s:%d", HttpAddr, HttpPort) | 101 | addr := HttpAddr |
| 102 | |||
| 103 | if HttpPort != 0 { | ||
| 104 | addr = fmt.Sprintf("%s:%d", HttpAddr, HttpPort) | ||
| 105 | } | ||
| 102 | var ( | 106 | var ( |
| 103 | err error | 107 | err error |
| 104 | l net.Listener | 108 | l net.Listener |
| ... | @@ -134,7 +138,6 @@ func (app *App) Run() { | ... | @@ -134,7 +138,6 @@ func (app *App) Run() { |
| 134 | } | 138 | } |
| 135 | err = s.ListenAndServe() | 139 | err = s.ListenAndServe() |
| 136 | } | 140 | } |
| 137 | |||
| 138 | } | 141 | } |
| 139 | if err != nil { | 142 | if err != nil { |
| 140 | BeeLogger.Fatal("ListenAndServe: ", err) | 143 | BeeLogger.Fatal("ListenAndServe: ", err) | ... | ... |
-
Please register or sign in to post a comment