Skip to content

mizalewski/elixir-unixbridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UNIX Socket to TCP Bridge

UNIX Bridge to TCP Bridge uses socat to create the tunnel between UNIX socket and TCP port. The library can be used with libraries, which need TCP port but you want to use UNIX socket (e.g. for Docker).

Inspiration to create this library was erldocker_unixbridge in Erlang library for Docker: erldocker.

Installation

The package can be installed by adding socket_tcp_bridge to your list of dependencies in mix.exs:

def deps do
  [{:socket_tcp_bridge, "~> 0.1.0"}]
end

Usage

Just start a process (in production use supervisor to monitor SocketTcpBridge process) with UNIX socket path and port:

{:ok, pid} = SocketTcpBridge.start_link("/var/run/docker.sock", 8000)

and you can connect to docker using port 8000 and Docker library which support Docker HTTP API.

Important: Library use socat, which need to be installed in your system.

About

Bridge between unix socket and tcp port

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages