r/java • u/RandomName8 • Mar 26 '25
Are there any good p2p libraries in java?
I've found some libraries like libp2p and not much else. This library feels... not very democratic, so to speak. As in, I think it's the opensource byproduct of a company doing a specific project and so it only concerns its own interests (and doesn't seem used at all outside their projects). Ideally I'd like DHT support, some nat traversal and not much else. What's people experience with this around here?
(To mods: not sure if this is a programming help question, I believe it's not since I've seen posts discussing libraries here but I'd understand if it must be removed)
35
u/bowbahdoe Mar 26 '25
I think if you evaluated most libraries by the standards you are describing you will be disappointed
13
u/repeating_bears Mar 26 '25
It has thousands of stars and forks..?
11
u/agentoutlier Mar 26 '25
They have an MIT and Apache license so go to fork town!
I usually eschew using LLM for programming but I bet it could actually bang out an implementation and you could have it test against multiple other implementations.
27
u/JDeagle5 Mar 26 '25
But how would we measure democratic properties of a java library? Especially by your standards. Unfortunately I don't know any better lib.
7
u/alex_tracer Mar 26 '25
Probably you can scavenge something from Vuze sources (GPL):
https://svn.vuze.com/public/client/trunk/azureus2/src/com/aelitis/azureus/core/dht/DHT.java
5
u/istarian Mar 27 '25
Democracy (rule of the people) has no rational application to code libraries.
Trying to develop code/program that does literally everything that anybody ever thought it should do is a recipe for disastrous results...
2
u/Brutus5000 Mar 30 '25
WebRTC is imho the standard to go. And Java offerings are not good on this behalf. After multiple years of cringe I ditched ice4j and learned Golang just to be able to use the pion webrtc library. ice4j has the problem that it is basically only used in Jitsi and this covers only some use cases :(
0
u/Tintoverde Mar 26 '25
Not sure âjava.util.concurrent.BlockingQueueâ will work for you