update: support ipv6 (#2288)

This commit is contained in:
yuyulei
2021-03-10 20:19:58 +08:00
committed by GitHub
parent b5aee82ca9
commit 8e25f13201
7 changed files with 25 additions and 21 deletions

View File

@ -15,7 +15,6 @@
package client
import (
"fmt"
"net"
"net/http"
"time"
@ -31,7 +30,7 @@ var (
httpServerWriteTimeout = 10 * time.Second
)
func (svr *Service) RunAdminServer(addr string, port int) (err error) {
func (svr *Service) RunAdminServer(address string) (err error) {
// url router
router := mux.NewRouter()
@ -51,7 +50,6 @@ func (svr *Service) RunAdminServer(addr string, port int) (err error) {
http.Redirect(w, r, "/static/", http.StatusMovedPermanently)
})
address := fmt.Sprintf("%s:%d", addr, port)
server := &http.Server{
Addr: address,
Handler: router,