Package org.ngengine.nostr4j.rtc.turn
Class NostrTURN
java.lang.Object
org.ngengine.nostr4j.rtc.turn.NostrTURN
TURN implemented on top of nostr relays.
When a p2p connection is not possible, the packets can be relayed through a nostr relay
using this class.
The packets are automatically compressed, encrypted and split into chunks to ensure a reliable
and private connection through public relays.
Note: this might cause unexpected heavy load on the relays, so use it only with relays that
explicitly support this kind of workload.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionNostrTURN
(String connectionId, NostrRTCLocalPeer localPeer, NostrRTCPeer remotePeer, NostrTURNSettings config) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(NostrTURN.Listener listener) void
close()
void
removeListener
(NostrTURN.Listener listener) void
start()
org.ngengine.platform.AsyncTask
<Void> write
(ByteBuffer data) Send some data to the remote peer.
-
Constructor Details
-
NostrTURN
public NostrTURN(String connectionId, NostrRTCLocalPeer localPeer, NostrRTCPeer remotePeer, NostrTURNSettings config)
-
-
Method Details
-
addListener
-
removeListener
-
start
public void start() -
close
public void close() -
write
Send some data to the remote peer.- Parameters:
data
- the data to send- Returns:
- a promise that resolves when the data is sent
-