Files
linuxkit/alpine/packages/proxy/main.go
David Scott eab69ef583 proxy: add exposePort and unexposePort stubs
This patch removes `proxyForever` and adds `sendError` and `sendOK` for
signalling to the parent process. The main function now sequences these
functions and calls stub functions `exposePort` and `unexposePort` which
will be hooked up in a later patch.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-04 12:41:02 +01:00

37 lines
531 B
Go

package main
import (
"log"
"net"
"os"
"pkg/proxy"
)
func main() {
host, container := parseHostContainerAddrs()
err := exposePort(host)
if err != nil {
sendError(err)
}
p, err := proxy.NewProxy(host, container)
if err != nil {
unexposePort(host)
sendError(err)
}
go handleStopSignals(p)
sendOK()
p.Run()
unexposePort(host)
os.Exit(0)
}
func exposePort(host net.Addr) error {
log.Printf("exposePort %#v\n", host)
return nil
}
func unexposePort(host net.Addr) {
log.Printf("unexposePort %#v\n", host)
}