Class NostrTURNCodec
java.lang.Object
org.ngengine.nostr4j.rtc.turn.NostrTURNCodec
Encode/Decode TURN packets (note: headers are decoded as SignedNostrEvent, but this class does not verify them).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancompareHeaders(ByteBuffer frame, byte[] headerFrame) static SignedNostrEventdecodeHeader(ByteBuffer frame) static voiddecodePayloads(ByteBuffer frame, List<byte[]> payloads) static ByteBufferencodeFrame(byte[] header, long vsocketId, int messageId, List<byte[]> payloads) static ByteBufferencodeFrame(byte[] header, long vsocketId, List<byte[]> payloads) static byte[]static byte[]extractHeaderFrame(ByteBuffer frame) static intextractMessageId(ByteBuffer frame) static longextractVsocketId(ByteBuffer frame) static ByteBufferwithVsocketId(ByteBuffer frame, long vsocketId) static ByteBufferwithVsocketIdAndMessageId(ByteBuffer frame, long vsocketId, int messageId)
-
Field Details
-
VERSION
public static final int VERSION- See Also:
-
-
Constructor Details
-
NostrTURNCodec
public NostrTURNCodec()
-
-
Method Details
-
encodeHeader
-
extractVsocketId
-
extractMessageId
-
withVsocketId
-
withVsocketIdAndMessageId
-
decodePayloads
-
encodeFrame
-
encodeFrame
public static ByteBuffer encodeFrame(byte[] header, long vsocketId, int messageId, List<byte[]> payloads) -
decodeHeader
-
extractHeaderFrame
-
compareHeaders
-