#unix-socket #applications #tcp #tcp-socket #bridge #tcp-port #sockets

app socketbridge

A bridge application for AF_UNIX and TCP sockets

1 stable release

1.0.0 Jan 5, 2025

#1385 in Network programming

Download history 121/week @ 2025-01-01 17/week @ 2025-01-08

138 downloads per month

MIT license

9KB
142 lines

socketbridge

A simple rust application similar to socat that bridges a unix socket to a local tcp port and vice versa.

As opposed to socat the socketbridge stays running also when the client(s) disconnect. However it still finishes when the server application that socketbridge is connected to as a client finishes.

There are two modes:

  • unix: creates a UNIX socket and forwards data to a TCP address.
  • tcp: creates a TCP server and forwards data to a UNIX socket.

Usage:

unix <UNIX_SOCKET_PATH> <TCP_ADDRESS>
tcp <TCP_PORT> <UNIX_SOCKET_PATH>

A sample setup involving an application running inside a docker container that communicates via the bridge to the other application on the host computer is available in the examples directory.

Dependencies

~1.1–1.7MB
~32K SLoC