croc icon indicating copy to clipboard operation
croc copied to clipboard

Peer-to-Peer (P2P)

Open Snake883 opened this issue 2 years ago • 13 comments

Is your feature request related to a problem? Please describe. Do not want to use a relay for Internet transfers. Don't want to use a public relay, don't want to pay somebody, don't want the complexity of setting up a private relay node.

Describe the solution you'd like Would like to use P2P rather than a public relay, or setting up a private relay.

Snake883 avatar May 29 '22 15:05 Snake883

https://github.com/schollz/croc#self-host-relay

schollz avatar May 29 '22 15:05 schollz

Is it possible to transfer not using a relay?

In P2P, is there an advantage of using a relay if the relay is the same person as either the sender/receiver?

Snake883 avatar Jun 03 '22 19:06 Snake883

I don't see how this would be realistically doable. These are very different protocols and architectures. This would be like trying to make a torrent client into a web browser. If anything that's an unequal comparison since p2p and croc are more complex than just http and TCP.

P2P has an overlaying virtual network to connect people through the internet and firewalls. Croc acts as a relay with an architecture also on top of TCP in addition to crypto operations to accomplish a similar goal. The two couldn't be more different though.

The backbone of Croc relies on relays to facilitate its connections. While p2p is obviously used without any kind of relays. The only time a central server may come into play is if there is a tracker server. If you're trying to add p2p and end up using a tracker server as well then at that point why not just use one of the many torrent apps that are already made for that? This is trying to add functionality for something that is almost the opposite of croc entirely.

Croc fills a unique hole as it stands. Turning it into basically a torrent client and adding tracking servers is overly complex (IMO) and unnecessary since there are numerous long standing p2p clients that accomplish this.

But I could be wrong. Someone may completely redesign the app from almost the ground up and abandon all other issues and feature requests to do something that's already been done numerous times. Something that, if it were actually created, would be just stable enough in a 1.0 version to run while competing against other apps that have been flushed out over decades.

sawft99 avatar Jun 10 '22 03:06 sawft99

You might want to look at qft if you want a direct P2P transfer.

TudbuT avatar Aug 17 '22 07:08 TudbuT

This is an interesting article about NAT traversal https://tailscale.com/blog/how-nat-traversal-works/ .

stefins avatar Aug 20 '22 12:08 stefins

I wonder if a compromise might work. What about having the option to configure the relay similar to how qft does things.

You can either run a full croc relay (the way it currently works) or a lite croc relay that only facilitates nat hole punching?

Or better yet, the relay tries hole punching first for a P2P connection and then falls back to how it works now?

It doesn't solve the "not wanting to run a relay" problem but it does potentially reduce load on relays and increase privacy when using the public relays since only connection metadata would be captured in P2P mode and absolutely nothing about the actual transfer.

Could also make it so if you've forwarded ports to your PC you can run croc in standalone p2p mode where you specify your listening port which is pretty much what qft appears to do. Requires more knowledge on the end users end to setup port forwarding correctly on their firewall though.

TheFiZi avatar Oct 21 '22 22:10 TheFiZi

Would libp2p be useful for this endeavor?

danielrode avatar Dec 16 '22 04:12 danielrode

Wonder if anything has been though about this. I have the feeling that it would save a lot on costs and bandwidth of hosting a relay.

Katzenwerfer avatar Feb 21 '23 02:02 Katzenwerfer

Hello,

I was talking with a few friends and one use that could be amazing is a way to support sending to multiple peoples. I think it's still 1 -> 1 right now.

I don't think it would be something really easy to implement but maybe... The easiest solution would be to use a torrent and public tracker but there will be some trouble about opening the right port that can be avoided with croc for now.

k-aito avatar Oct 30 '23 10:10 k-aito

Stale issue message

github-actions[bot] avatar Feb 22 '24 12:02 github-actions[bot]

not stale!

derhuerst avatar Feb 22 '24 16:02 derhuerst

Stale issue message

github-actions[bot] avatar Apr 23 '24 12:04 github-actions[bot]

still not stale!

derhuerst avatar Apr 23 '24 15:04 derhuerst