Package org.ngengine.nostr4j.rtc.turn
Class NostrTURN
- java.lang.Object
-
- org.ngengine.nostr4j.rtc.turn.NostrTURN
-
public class NostrTURN extends java.lang.Object
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 Modifier and Type Class Description static interface
NostrTURN.Listener
-
Constructor Summary
Constructors Constructor Description NostrTURN(java.lang.String connectionId, NostrRTCLocalPeer localPeer, NostrRTCPeer remotePeer, NostrTURNSettings config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(NostrTURN.Listener listener)
void
close()
void
removeListener(NostrTURN.Listener listener)
void
start()
org.ngengine.platform.AsyncTask<java.lang.Void>
write(java.nio.ByteBuffer data)
Send some data to the remote peer.
-
-
-
Constructor Detail
-
NostrTURN
public NostrTURN(java.lang.String connectionId, NostrRTCLocalPeer localPeer, NostrRTCPeer remotePeer, NostrTURNSettings config)
-
-
Method Detail
-
addListener
public void addListener(NostrTURN.Listener listener)
-
removeListener
public void removeListener(NostrTURN.Listener listener)
-
start
public void start()
-
close
public void close()
-
write
public org.ngengine.platform.AsyncTask<java.lang.Void> write(java.nio.ByteBuffer data)
Send some data to the remote peer.- Parameters:
data
- the data to send- Returns:
- a promise that resolves when the data is sent
-
-