root-gg / plik

Plik is a temporary file upload system (Wetransfer like) in Go.
https://plik.root.gg
Other
1.47k stars 168 forks source link

streaming to multiple clients #456

Closed oupala closed 1 year ago

oupala commented 2 years ago

Is it possible with plik to stream a file to multiple clients? If yes, I did not manage to do this...

This could be useful when trying to distribute a file to all attendees of a training.

camathieu commented 2 years ago

It is by design impossible to achieve this. The best is to upload the file and to delete it once everybody downloaded the file.

On Wed, Sep 14, 2022 at 6:20 PM oupala @.***> wrote:

Is it possible with plik to stream a file to multiple clients? If yes, I did not manage to do this...

This could be useful when trying to distribute a file to all attendees of a training.

— Reply to this email directly, view it on GitHub https://github.com/root-gg/plik/issues/456, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQ5XPQC6G3D3KTJOYYL3DDV6H3OFANCNFSM6AAAAAAQMSQ4EU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

oupala commented 2 years ago

You say it is impossible, but it appears that another tool is achieving this: Just drop it.

You can have a look at the third screenshot and see that the file is currently being distributed to two clients.

Is there any particular (design?) reason that make multiple streaming impossible to achieve for Plik, but possible for Just drop it?

camathieu commented 2 years ago

The current client / server architecture is not designed to achieve this without heavy modifications. It would need to be able to upload the same file several times in parallel and to serve it under the same URL.

On Wed, Sep 14, 2022, 23:20 oupala @.***> wrote:

You say it is impossible, but it appears that another tool is achieving this: Just drop it https://github.com/Orange-OpenSource/just-drop-it.

You can have a look at the third screenshot and see that the file is currently being distributed to two clients.

Is there any particular (design?) reason that make multiple streaming impossible to achieve for Plik, but possible for Just drop it?

— Reply to this email directly, view it on GitHub https://github.com/root-gg/plik/issues/456#issuecomment-1247314550, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQ5XPVVJP6ELE3EVC3CW4DV6I6SJANCNFSM6AAAAAAQMSQ4EU . You are receiving this because you commented.Message ID: @.***>

oupala commented 2 years ago

I think that this is the way Just drop it is working when streaming file to multiple clients: opening one websocket per client:

schema

I note that plik is currently designed for one to one stream transfer.

camathieu commented 1 year ago

There is no websocket involved. The content of the upload request body is piped directly to the download response body without any buffering

camathieu commented 1 year ago

For streaming to multiple clients maybe you can look at torrent protocols

m2acgi commented 10 months ago

piping-server support stream to multiple client: https://github.com/nwtgck/piping-server#transfer-to-multiple-receivers