Commit Graph

7 Commits

Author SHA1 Message Date
David Scott
f269d6289b proxy: request a vsock connection rather than a TCP/IP one
Note this means we don't need to figure out our local IP address.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
74be577a0f proxy: simply the Dockerfile by shuffling code under vendor/
Note there is a slight name clash between the final binary 'proxy'
and the library formerly known as 'proxy'. Resolve this by calling
the library 'libproxy'.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
9acc04f99b proxy: determine "my" address by examining the "docker" forward
When requesting a port forward we currently need to know the VM's
address from the point of view of the port forwarder. The easiest way to
discover this is to read it from the existing "docker" port forward.

Note this should all be revamped once we have vsock support.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-04 12:41:02 +01:00
David Scott
00ff8897a7 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
David Scott
a8fc95eb9d proxy: on exit, return to main for cleanup
Previously the proxy.go would directly call `os.Exit`. This patch
causes control to return to `main` where we can tear down any port
forward.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-04 12:41:02 +01:00
David Scott
444a6147d9 proxy: split the execProxy function into parts
Previously `execProxy` would
- create the proxy
- signal success/failure to the parent
- run forever (until signalled)

Since we want to add more proxy setup and teardown, this patch
removes the proxy creation from `execProxy` and renames it to
`proxyForever`. Later patches will be able to perform the necessary
side-effects before signalling success to the parent.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-04 12:41:02 +01:00
David Scott
e1b8975016 Import docker/libnetwork/portmapper/proxy.go
Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-04 12:41:02 +01:00