connectd allows the use of a provisioning, or configuration, file to allow better organization of multiple P2P connections. Here is a sample provisioning file for a P2P initiator.
Sample P2P provisioning file
Here is an example p2p provisioning file. Copy this to your computer and edit the details.
# setting autoconnect to 1 will autoconnect the p2p initiator to the target
# setting autoconnect to 2 will attempt to automatically reconnect in the event
# of a network interruption
#user ID to use for the initiator connection (required)
# proxy local IP to bind to, can be 127.0.0.1, 0.0.0.0 or any local adapter IP
# remote_address is the (UID) address of the target to connect to.
# Maximum buffer depth for each TCP connection (10-25)
# default 35
# raise for high latency environments
# The number of minutes this proxy should last. Set this to 0 for no limit.
# The amount of time to wait if there are no active tunnels before terminating the connection.
# Set this to 0 for no limit. The setting for PROXYLIFETIME still applies.
# keep this comment line here
Copy and save this text to a file that corresponds to your target Service. For example, if the UID is for an SSH Service running on your Pi, you could call this file SSH-Pi.txt.
Edit the following entries to match your account and target device.
user_id - your remote.it account user name
auth_hash - your remote.it account authhash How to get your authhash
remote_address - your target Service's UID How to get your UID
proxy_local_port - desired localhost port
Launching the P2P initiator
connectd -f SSH-Pi.txt &
The script will output connection information, then after about 10 seconds, you should see:
Starting Proxy on port 33000 on index 1.
To get the process ID (PID) so that you can kill the connection when you are done, type:
immediately following the connectd command.
Now you can connect to your target remote.it Service using 127.0.0.1 and the port value you chose. The P2P connection will stay open until you terminate the process using "kill", or the internet connection drops.
Supposing that the value was 21456, then when you are done with the P2P connection, type:
Automatically maintain the P2P connection
You can set the autoconnect parameter value to 2 in the initiator provisioning file to have the daemon automatically attempt to reconnect to the target in the event of a network interruption.