proxy: add a multiplexing server frontend

On a Hyper-V system we can only register one listening endpoint (with
a GUID), so we need to accept connections, read a header and then
start the proxy.

If the binary has argv[0] == "proxy-vsockd" then run this new frontend.

Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
David Scott
2016-05-17 22:14:59 +01:00
parent be3e256015
commit 5090fd9599
7 changed files with 240 additions and 77 deletions

View File

@@ -75,6 +75,19 @@ func (u *udpEncapsulator) Close() error {
return nil
}
func NewUDPConn(conn net.Conn) udpListener {
var m sync.Mutex
var r sync.Mutex
var w sync.Mutex
return &udpEncapsulator{
conn: &conn,
listener: nil,
m: &m,
r: &r,
w: &w,
}
}
func NewUDPListener(listener net.Listener) udpListener {
var m sync.Mutex
var r sync.Mutex