Option 2: connectd P2P initiator using a simple script (Windows PowerShell)

Overview

The script p2p.ps1 automates some of the tasks needed to make a repeatable P2P connection to a single Service. This script is intended to demonstrate show to create P2P connections in Powershell. In general, if you are running Windows and wish to manage P2P connections, you should install the remoteit Desktop and use that.

 

Download the script

Download the attached p2p.zip file, then extract the p2p.ps1 script to the same folder where you downloaded connectd.exe on your system.

Edit the following values in p2p.ps1 as needed, then save the file.

  • uid - the UID of the Service you are connecting to.  How do I find this?
  • port - any number between 33000 and 65535
  • address - localhost, usually 127.0.0.1, but can be any 127.x.y.z where x, y, and z are less than or equal to 255

Run the script

Run:

.\p2p.ps1

The script will interactively request the username and authhash for your remote.it account. 

How do I get my account authhash?

The script starts up and if everything was entered correctly, you'll see something similar to:

mceclip0.png

This script runs connectd in the background so that you can continue to use the command prompt, and after about 10 seconds, shows you the command you can use to kill the connection when you are done. The value shown in the "kill" command is the process ID (PID) of the connectd daemon which was just launched.

Your connection is now active on 127.0.0.1 port 33100.

To terminate this connection, type in:
kill 21152
$

To use the connection for ssh, type:

$ ssh -l pi localhost -p 33100

The syntax for other applications will depend on the specifics of those applications.

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