2.3.1 • Published 3 years ago

turn-packet-parser v2.3.1

Weekly downloads
25
License
ISC
Repository
-
Last release
3 years ago

Turn Packet Parser

Turn packet parser with fully type support and zero dependency on other modules. (exclude devDependency)

Parse the binary string to the messages defined in rfc 8489 - Session Traversal Utilities for NAT and rfc 8656 - Traversal Using Relays around NAT (TURN).

Example

You can play on runKit https://runkit.com/sj82516/5ff13005da38dc001a7ba9c1

var TurnPacketParser = require("turn-packet-parser").default;
const parser = new TurnPacketParser();
const rawBinaryString = "0101000c2112a44274466a45716e437a67457242002000080001d8b41de7de90";
const stunMessage = parser.parse(rawBinaryString);
console.log(JSON.stringify(stunMessage))

//// output
 {
    "class": "response",
    "method": "bind",
    "transactionId": "74466a45716e437a67457242",
    "attributeList": {
        "xorMappedAddress": {
            "family": 1,
            "port": 63910,
            "address": "60.245.122.210",
            "length": 8,
            "value": "0001d8b41de7de90"
        }
    }
}
2.3.0

3 years ago

2.3.1

3 years ago

2.2.0

3 years ago

1.0.8

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago