*: initial support for gatway

etcd gatway is a simple l4 gateway that forwards tcp connections to
the given endpoints.
This commit is contained in:
Xiang Li
2016-04-14 21:00:03 -07:00
parent 07c04c7c75
commit a300be92dc
5 changed files with 155 additions and 33 deletions

View File

@ -22,7 +22,6 @@ import (
"net/http/httptest"
"net/url"
"testing"
"time"
)
func TestUserspaceProxy(t *testing.T) {
@ -43,17 +42,12 @@ func TestUserspaceProxy(t *testing.T) {
t.Fatal(err)
}
p := tcpProxy{
l: l,
donec: make(chan struct{}),
monitorInterval: time.Second,
remotes: []*remote{
{addr: u.Host},
},
p := TCPProxy{
Listener: l,
Endpoints: []string{u.Host},
}
go p.run()
defer p.stop()
go p.Run()
defer p.Stop()
u.Host = l.Addr().String()