NodeOPCUA API Documentation
    Preparing search index...

    Function decodeReverseHello

    • Decode a ReverseHello ("RHE") message from a raw TCP message chunk.

      The chunk MUST be a single, final ("F") RHE frame: [ 'R' 'H' 'E' ] [ 'F' ] [ UInt32 messageSize ] [ ServerUri ] [ EndpointUrl ]

      This deliberately does NOT go through tools.ts#decodeMessage, whose is_valid_msg_type allowlist / ERR special-casing does not apply to RHE, and because the inbound readMessageHeader does not itself validate the 3-char message type — so we assert it here.

      Parameters

      • messageChunk: Buffer

      Returns ReverseHelloMessage

      an Error tagged with .statusCode = BadTcp* when the message is not a well-formed RHE or when either field exceeds the 4096-byte spec limit.