Skip to content

Correct way to implement private relay? #5135

Answered by gnattu
Snarpix asked this question in Q&A
Discussion options

You must be logged in to vote

I encountered a similar issue and ended up forking libp2p-tls to create my own certification validation mechanism. Upon examining the current implementations, I found that much of the connection handling focuses on ensuring that the other end is libp2p based rather than based on my-program, which makes it difficult to reject connections from other libp2p clients.

A more supported approach would be to implement your own protocol and include it in libp2p::identify. Then, you can reject all clients (such as by immediately closing the connection) that do not support your defined protocol. You can use a method to encrypt your protocol string with the PSK, and then let the remote side decrypt t…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Snarpix
Comment options

You must be logged in to vote
1 reply
@dhuseby
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants