junixsocket-darwin
Darwin (macOS)-specific sockets from Java!
junixsocket is an Apache 2.0-licensed Java/JNI library that allows the use of Unix Domain Sockets (AF_UNIX sockets), and other address/protocol families (such as TIPC), from Java.
AF_SYSTEM
AF_SYSTEM
is one way to communicate with the macOS (Darwin) Kernel from userspace.
Most often, you still have to be root to connect, however you may of course send a file descriptor to a lesser privileged process and continue the work there.
One feature junixsocket exposes is UTUN_CONTROL
, which lets you set up PtP tunnel interfaces (utun
)
from userspace. This can be used to implement VPNs, for example. AF_SYSTEM with UTUN_CONTROL is
the macOS pendant to Linux's tun
functionality.
Examples
AF_NDRV
This is pretty much a “Fake Ethernet” driver; it's the macOS pendant to Linux's tap
functionality.
A future version of junixsocket may add support for this domain.
AF_MULTIPATH
This is an Apple-private domain to implement Multipath-TCP/IP.
A future version of junixsocket may add support for this domain.
Maven dependencies
Add the following dependency to your project (replace X.Y.Z. with the latest junixsocket version).
<dependency>
<groupId>com.kohlschutter.junixsocket</groupId>
<artifactId>junixsocket-darwin</artifactId>
<version>X.Y.Z</version>
</dependency>