https://github.com/mizalewski/elixir-unixbridge
Bridge between unix socket and tcp port
https://github.com/mizalewski/elixir-unixbridge
elixir socat unix-socket
Last synced: 4 months ago
JSON representation
Bridge between unix socket and tcp port
- Host: GitHub
- URL: https://github.com/mizalewski/elixir-unixbridge
- Owner: mizalewski
- License: mit
- Created: 2017-03-18T19:38:21.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-21T07:41:23.000Z (over 8 years ago)
- Last Synced: 2025-10-10T16:56:31.322Z (9 months ago)
- Topics: elixir, socat, unix-socket
- Language: Elixir
- Size: 7.81 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UNIX Socket to TCP Bridge
UNIX Bridge to TCP Bridge uses [socat](https://www.linux.com/news/socat-general-bidirectional-pipe-handler) 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](https://github.com/proger/erldocker).
## Installation
The package can be installed by adding `socket_tcp_bridge` to your list of dependencies in `mix.exs`:
```elixir
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:
```elixir
{: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.