Class NostrTURN

java.lang.Object
org.ngengine.nostr4j.rtc.turn.NostrTURN

public class NostrTURN extends 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.
  • Constructor Details

  • Method Details

    • 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<Void> write(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