Using connectd in P2P initiator mode on macOS and Linux


This guide describes the use of the connectd daemon on the initiator device so that you can incorporate P2P connection initiator functionality into your own programs.  If you simply wish to use P2P connections, we suggest that you download and install the Desktop Application.


Download the connectd daemon

The connectd daemon is used on your target device to enable Services. The same connectd daemon is used on the initiator device, on the client side of a P2P connection, although in a different mode, in order to connect to those Services.

The commands below show you how to use the macOS console to download and run the connectd daemon on a computer running macOS. Although this example is for the macOS version of the daemon, we have many other versions of daemon available.

# Download the most recent release (this is for OSX)
curl -LkO
# Make it executable
chmod u+x connectd.x86_64-osx
# Move to a folder on your PATH
mv connectd.x86_64-osx /usr/local/bin/
# Add a connectd symlink to point at the daemon
ln -s /usr/local/bin/connectd.x86_64-osx /usr/local/bin/connectd

Quick install for Linux systems

Please follow these instructions to download and install the connectd daemon on any Linux system. This also takes care of creating a connectd symlink.


Run connectd Network Diagnostics

To confirm that you have the correct connectd daemon for your device and its OS, and that your network is configured correctly to allow a connection, run connectd -n at the command line in order to run Network Diagnostics. You may have to configure any virus checker that you are using in order to allow connectd to be run. The output from connectd -n should be similar to the following:

My-Air-2:~ macuser$ connectd -n
Connectd built Apr 19 2019 at 16:46:38 Now Starting Up
Version 4.6 - (c)2019, Inc. All Rights Reserved
MAC OSX Version
alloc pool
Running Network Diagnostics
Checking if DNS works ... .[OK]
Checking TCP connectivity to<oip=> [OK]
Checking UDP connectivity to
Send to [] [mip=] [oport=59612 mport=59612] [preserve port]
Send to [] [mip=] [oport=59612 mport=59612] [no remap] [preserve port]
Send to [] [mip=] [oport=59612 mport=59612] [no remap] [preserve port different IP] [OK]

This router preserves ports, this is optimal.
This router doesn't remap new connections to new ports.
Static Pool Free
Endian : Little
SHA1 test:
RC4 test:
XXTEA test:
Looks compatible.
Mac-Air-2:~ macuser$


Was this article helpful?
0 out of 0 found this helpful