adding ipv6 support because i like ipv6
This commit is contained in:
parent
a7c52fd177
commit
223cc8b60b
2 changed files with 53 additions and 1 deletions
14
main.go
14
main.go
|
|
@ -24,6 +24,7 @@ import (
|
|||
"arimelody-web/log"
|
||||
"arimelody-web/model"
|
||||
"arimelody-web/view"
|
||||
amnet "arimelody-web/net"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
_ "github.com/lib/pq"
|
||||
|
|
@ -518,7 +519,18 @@ func main() {
|
|||
|
||||
// start the web server!
|
||||
mux := createServeMux(&app)
|
||||
fmt.Printf("Now serving at http://%s:%d\n", app.Config.Host, app.Config.Port)
|
||||
server := &amnet.DualStackHTTPServer{ Handler: mux }
|
||||
if err := server.ListenAndServe(app.Config.Host, "::", int(app.Config.Port)); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf(
|
||||
"Now listening on port %d (http://%s:%d, http://[%s]:%d)\n",
|
||||
app.Config.Port,
|
||||
app.Config.Host,
|
||||
app.Config.Port,
|
||||
"::",
|
||||
app.Config.Port,
|
||||
)
|
||||
stdLog.Fatal(
|
||||
http.ListenAndServe(fmt.Sprintf("%s:%d", app.Config.Host, app.Config.Port),
|
||||
CheckRequest(&app, HTTPLog(DefaultHeaders(mux))),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue