watson / bonjour

A Bonjour/Zeroconf protocol implementation in JavaScript
MIT License
627 stars 146 forks source link

bug in parsing section when '.' #37

Closed thosil closed 3 years ago

thosil commented 7 years ago

When there are "." (dots) in the name, bonjour can't parse correctly the name and types. Ex: query_10.193.31.168._nmos-query._tcp.local is parsed as this:

{
    "addresses": [],
    "rawTxt": {
        "type": "Buffer",
        "data": [
            22,
            97,
            112,
            105,
            95,
            118,
            101,
            114,
            61,
            118,
            49,
            46,
            48,
            44,
            118,
            49,
            46,
            49,
            44,
            118,
            49,
            46,
            50,
            14,
            97,
            112,
            105,
            95,
            112,
            114,
            111,
            116,
            111,
            61,
            104,
            116,
            116,
            112,
            5,
            112,
            114,
            105,
            61,
            48
        ]
    },
    "txt": {
        "api_ver": "v1.0,v1.1,v1.2",
        "api_proto": "http",
        "pri": "0"
    },
    "name": "query_10",
    "fqdn": "query_10.193.31.168._nmos-query._tcp.local",
    "host": "vmdocker.local",
    "referer": {
        "address": "10.193.31.168",
        "family": "IPv4",
        "port": 5353,
        "size": 289
    },
    "port": 80,
    "type": "193",
    "protocol": "31",
    "subtypes": [
        "168",
        "nmos-query",
        "tcp"
    ]
}
thosil commented 7 years ago

see issue #19

thosil commented 7 years ago

Seems the build chain for some node.js version is broken, I tried to look a little bit what's going wrong but I can't spend more time on this part. Anyway the problem is related to standard and some broken plugin when using node.js < 4: ` $ npm test

bonjour@3.5.0 test /home/travis/build/watson/bonjour standard && tape test/*.js standard: Unexpected linter output: TypeError: Failed to load plugin react: undefined is not a function Referenced from: /home/travis/build/watson/bonjour/node_modules/standard/eslintrc.json at Object. (/home/travis/build/watson/bonjour/node_modules/standard/node_modules/eslint-plugin-react/node_modules/jsx-ast-utils/lib/values/expressions/index.js:106:28) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/home/travis/build/watson/bonjour/node_modules/standard/node_modules/eslint-plugin-react/node_modules/jsx-ast-utils/lib/values/index.js:17:20) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) `

@watson Could you check it please? (but are you still maintaining this repo?)