Class NostrTURNCodec

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

public final class NostrTURNCodec extends Object
Encode/Decode TURN packets (note: headers are decoded as SignedNostrEvent, but this class does not verify them).
  • Field Details

  • Constructor Details

    • NostrTURNCodec

      public NostrTURNCodec()
  • Method Details

    • encodeHeader

      public static byte[] encodeHeader(SignedNostrEvent ev)
    • extractVsocketId

      public static long extractVsocketId(ByteBuffer frame)
    • extractMessageId

      public static int extractMessageId(ByteBuffer frame)
    • withVsocketId

      public static ByteBuffer withVsocketId(ByteBuffer frame, long vsocketId)
    • withVsocketIdAndMessageId

      public static ByteBuffer withVsocketIdAndMessageId(ByteBuffer frame, long vsocketId, int messageId)
    • decodePayloads

      public static void decodePayloads(ByteBuffer frame, List<byte[]> payloads)
    • encodeFrame

      public static ByteBuffer encodeFrame(byte[] header, long vsocketId, List<byte[]> payloads)
    • encodeFrame

      public static ByteBuffer encodeFrame(byte[] header, long vsocketId, int messageId, List<byte[]> payloads)
    • decodeHeader

      public static SignedNostrEvent decodeHeader(ByteBuffer frame)
    • extractHeaderFrame

      public static byte[] extractHeaderFrame(ByteBuffer frame)
    • compareHeaders

      public static boolean compareHeaders(ByteBuffer frame, byte[] headerFrame)