Allow configurable addresses for everything

This commit is contained in:
Asim
2015-05-16 00:34:02 +01:00
parent c77be7c571
commit 0e7bd77f4c
13 changed files with 143 additions and 41 deletions

View File

@@ -10,6 +10,7 @@ import (
"strconv"
"sync"
"github.com/bradfitz/http2"
log "github.com/golang/glog"
"github.com/myodc/go-micro/errors"
rpc "github.com/youtube/vitess/go/rpcplus"
@@ -190,7 +191,13 @@ func (s *RpcServer) Start() error {
s.address = l.Addr().String()
s.mtx.Unlock()
go http.Serve(l, http.HandlerFunc(s.handler))
srv := &http.Server{
Handler: http.HandlerFunc(s.handler),
}
http2.ConfigureServer(srv, nil)
go srv.Serve(l)
go func() {
ch := <-s.exit