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

Implement blind relay support #135

Merged
merged 26 commits into from
Sep 29, 2023
Merged

Implement blind relay support #135

merged 26 commits into from
Sep 29, 2023

Conversation

kasperisager
Copy link
Contributor

@kasperisager kasperisager commented Aug 29, 2023

This PR implements client connection support for the blind relay protocol (https://github.com/holepunchto/blind-relay). This allows peers running in both client and server mode to establish connections to other peers through blind relays. Additionally, an initial implementation of a connection pool has been added, providing a way to more efficiently manage and deduplicate connections to other peers. When provided with a connection pool, peers will use the pool for outbound connections to blind relays.

@kasperisager kasperisager changed the title Implement connection relaying Implement bridging relay support Sep 8, 2023
lib/connection-pool.js Outdated Show resolved Hide resolved
lib/connection-pool.js Outdated Show resolved Hide resolved
lib/connection-pool.js Outdated Show resolved Hide resolved
lib/connect.js Outdated Show resolved Hide resolved
@kasperisager
Copy link
Contributor Author

Removed use of the connection pool for outbound connections to relays for now and instead destroy the relay socket when the raw stream closes. This isn't optimal, but should at least be correct.

lib/connect.js Outdated Show resolved Hide resolved
@kasperisager kasperisager marked this pull request as ready for review September 26, 2023 08:35
lib/server.js Outdated Show resolved Hide resolved
@kasperisager kasperisager changed the title Implement bridging relay support Implement blind relay support Sep 29, 2023
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@@ -9,10 +9,13 @@ async function runTests () {

await import('./announces.js')
await import('./connections.js')
await import('./holepuncher.js')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ouch

@mafintosh mafintosh merged commit d5ee341 into main Sep 29, 2023
3 checks passed
@mafintosh mafintosh deleted the connection-relaying branch September 29, 2023 10:09
@lanmower
Copy link

Thank you both of you, this is huge. 🙏🥳

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

Successfully merging this pull request may close these issues.

3 participants