SpatiumPortae/portal

Connecting to multiple receiving clients at once

VioPaige opened this issue · 3 comments

I've looked through the docs, but I cannot find any way to share a file with multiple people (other than opening two instances). Is there a way? If not, I suggest it is implemented, it would be a quite useful feature!

Hi!

You are right in that there is currently no way for one sender to send files to multiple recipients at the same time, apart from opening multiple instances.

This is partially due to how the encryption works -- in that the temporarily output password that you share with the recipient is temporary in its nature, and is used to agree upon a much stronger encryption between the clients. How we have implemented this protocol (PAKE) can actually be extended to work for multiple clients at the same time, though.

Apart from that, Portal in its current state is built around the relay server not buffering any data. That means sent data is relayed as soon as possible to the recipient, never stored on the server. Thus, multiple clients would need to be quite synchronized in receiving the data -- possibly by only starting the transfer when "all" recipients are connected.

Portal is not really meant for this use case, but you can get around it by opening multiple instances :)

Alright, thanks for the lovely detailed answer!

Alright, thanks for the lovely detailed answer!

Of course!

@VioPaige

I have a suggestion if you want to streamline creating multiple senders and get all of their passwords using a bash script.

Use the raw flag with portal send to skip all the fancy TUI stuff and just get the password.

I wrote a very shoddy example so you can get an idea:

multiple-senders.sh

#!/bin/bash

for i in $(seq "$1"); do
  SENDER_OUTPUT="/tmp/portal-sender-$i"
  portal send file.txt -s=raw > $SENDER_OUTPUT &
  while [ ! -f $SENDER_OUTPUT ]; do sleep 1; done
  head -n 1 $SENDER_OUTPUT
  rm $SENDER_OUTPUT
done

Usage:

$ ./multiple-senders 4
> 19-quasar-delta-elliptical
> 20-sigma-liquid-orbit
> 21-ray-micro-static
> 22-gas-neutron-quark