proxy: remove the dynamic vsock port allocation

On both Mac and Windows we have one well-known port and a SOCKS-like
port to tunnel connections through it. This was necessary on Windows
where ports have well-known GUIDs, but we might as well do it the same
way on both platforms for consistency.

This patch removes the dynamic binding of vsock ports, which fails on
a Windows Moby anyway.

Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
David Scott 2016-05-26 16:52:10 +01:00
parent 8bc6e72020
commit a6a1c4b1a6

View File

@ -3,7 +3,6 @@ package main
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/rneugeba/virtsock/go/vsock"
"log" "log"
"net" "net"
"os" "os"
@ -12,12 +11,8 @@ import (
) )
func onePort() { func onePort() {
host, port, container := parseHostContainerAddrs() host, _, container := parseHostContainerAddrs()
vsockP, err := libproxy.NewVsockProxy(&vsock.VsockAddr{Port: uint(port)}, container)
if err != nil {
sendError(err)
}
ipP, err := libproxy.NewIPProxy(host, container) ipP, err := libproxy.NewIPProxy(host, container)
if err != nil { if err != nil {
sendError(err) sendError(err)
@ -31,8 +26,7 @@ func onePort() {
go handleStopSignals(ipP) go handleStopSignals(ipP)
// TODO: avoid this line if we are running in a TTY // TODO: avoid this line if we are running in a TTY
sendOK() sendOK()
go ipP.Run() ipP.Run()
vsockP.Run()
ctl.Close() // ensure ctl remains alive and un-GCed until here ctl.Close() // ensure ctl remains alive and un-GCed until here
os.Exit(0) os.Exit(0)
} }