Transfer module: Connect

Connect to a peer via a TCP connection either to send or receive data.

Example

Sending hello.txt:

cat hello.txt | space -m transfer /connect/ -- "192.168.0.10" "9333"

Receiving cat.png:

space -m transfer /connect/ -- "192.168.0.10" "9333" > cat.png

Connect securely

Sending hello.txt:

cat hello.txt | space -m transfer /connect/ -- "192.168.0.10" "9333" "1"

Or using environment variables:

Sending hello.txt:

cat hello.txt | space -m transfer /connect/ -e host=192.168.0.10 -e port=9333 -e secure=1

Skip server certificate verification:

cat hello.txt | space -m transfer /connect/ -e host=192.168.0.10 -e port=9333 -e secure=1 -e verify=0

Exit status code is expected to be 0 on success.

Edit this page