Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2P mode #4

Open
felinira opened this issue Mar 16, 2022 · 3 comments
Open

P2P mode #4

felinira opened this issue Mar 16, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@felinira
Copy link
Contributor

Currently the code seems to send all files via a relay. Would it be within the scope of this project to implement a peer to peer mode? It would probably require some modification to the portal to negotiate some out-of-band channel.

In the best case this negotiation would be encrypted, see #3

I could probably contribute code if this is desired.

@landhb
Copy link
Owner

landhb commented Mar 18, 2022

It's not currently in scope but I'm open to PRs if you're up for it.

I'm not too familiar with P2P protocols but sounds like it would likely be a substantial protocol change. Especially solving the NAT issue etc.

@landhb landhb added the enhancement New feature or request label Mar 20, 2022
@landhb
Copy link
Owner

landhb commented Mar 20, 2022

Good article from Tailscale on NAT traversal: https://tailscale.com/blog/how-nat-traversal-works/

@landhb
Copy link
Owner

landhb commented Apr 2, 2022

Just some notes:

This may be easier to implement in the client with the new API introduced in v0.4.0.

I'd imagine Portal::handshake() and Portal::outgoing() would still happen via the relay over TCP. And then a new UDP/QUIC stream could be used with Portal::send_file() to actually transfer the file in a P2P manner. Peering info could be exchanged through the relay in the TransferInfo or ConnectMessage structs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants