public class TcpToUnixSocketProxy extends Object
Like socat TCP-LISTEN:2375,fork UNIX-CONNECT:/var/tmp/docker.sock, except this is literally the only
thing this program does.
Purposefully simplistic in implementation, using blocking I/O for simplicity over performance.
| Constructor and Description |
|---|
TcpToUnixSocketProxy(File unixSocketFile)
Create an instance of the proxy that will listen for TCP connections on localhost on a
random available port.
|
TcpToUnixSocketProxy(String listenHostname,
int listenPort,
File unixSocketFile)
Create an instance of the proxy.
|
| Modifier and Type | Method and Description |
|---|---|
InetSocketAddress |
start()
Start the proxy
|
void |
stop()
Stop the proxy.
|
public TcpToUnixSocketProxy(File unixSocketFile)
This should be the usual method of instantiating a proxy.
unixSocketFile - the local unix domain socket as a Filepublic TcpToUnixSocketProxy(String listenHostname, int listenPort, File unixSocketFile)
listenHostname - hostname to listen onlistenPort - port to listen on, or 0 if an available port should be allocatedunixSocketFile - the local unix domain socket as a Filepublic InetSocketAddress start() throws IOException
IOException - on socket binding failurepublic void stop()
Copyright © 2016. All rights reserved.