public Socket createSocket() throws IOException {
        if (!isAvailable()) {
            throw new UnsupportedOperationException("Unix Domain Socket support is not available");
        }

        try {
            if (IMPLEMENTATION == Implementation.JDK) {
                // Java 16+ only supports UDS through the SocketChannel API, but the sync client is coupled
                // to the legacy Socket API. In order to use Java sockets, we first need to write an
                // adapter, similar to the one provided by JUnixSocket.
                throw new UnsupportedOperationException("JEP 380 Unix domain sockets are not supported; use "
                        + "JUnixSocket");
            } else {
                // JUnixSocket implementation
                final Class<?> socketClass = Class.forName(JUNIXSOCKET_SOCKET_CLASS);
                final Method newInstanceMethod = socketClass.getMethod("newInstance");
                return (Socket) newInstanceMethod.invoke(null);
            }
        } catch (final Exception e) {
            throw new IOException("Failed to create Unix domain socket", e);
        }
    }
Gets the singleton instance of {@link UnixDomainSocketFactory}.

@return the singleton instance
httpclient5/src/main/java/org/apache/hc/client5/http/socket/UnixDomainSocketFactory.java