{"_id":"@acastellon/dns-client","_rev":"7-cff7657072dfb46af6987640a656fa72","name":"@acastellon/dns-client","dist-tags":{"latest":"1.3.1"},"versions":{"1.0.0":{"name":"@acastellon/dns-client","version":"1.0.0","keywords":["dns","ws","rest"],"author":{"name":"Antonio Castellon"},"license":"MIT","_id":"@acastellon/dns-client@1.0.0","maintainers":[{"name":"acastellon","email":"antonio@castellon.ch"}],"homepage":"https://github.com/antonio-castellon/module-dns-client#readme","bugs":{"url":"https://github.com/antonio-castellon/module-dns-client/issues"},"dist":{"shasum":"bafd292ac50a54341b5e0d2c6a769042d0ae958b","tarball":"https://registry.npmjs.org/@acastellon/dns-client/-/dns-client-1.0.0.tgz","fileCount":6,"integrity":"sha512-csLFnpALcMOKhtEWntrz3SvfhPhHe9jB1ljiwxZa+MtF3lb/D9SgAGVUmY1OydSvnHRepvlznCEB2vorWmDacg==","signatures":[{"sig":"MEUCIGiBxpSJGeKAOVBPbvFZ/NmLypN1UrZR9gms9LAeYL7cAiEAwsylLvgxZ9Mqeskxcvy3Gvk3FGe92wcAjPKBeVj/PeI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdtsJ/CRA9TVsSAnZWagAAKXEQAIpXaxQe/bdzVGHlJgCA\n7sNKdCmTygZR9wp34ewGVwMTJxwGnRyAOwqLggNXaNFmTTA/K91/yK6106Vi\n4AFW4/n5ZP//E+JYkyKtAAyQu2kOG4Hh+X5WXWPzghRtqVlUVexajg+WUufa\n40M36fI00KNIKIkX1hKiezCHHH3aA66GCbw2b6tLPSjG4MIMxH55toDVIzbK\nXnTtShX2noWTexTOc3geTW93QoLy1iNyy5DltBIzMzrPuHwxUjkS3HPuPfmI\nNqxS8V8GDgx3UBUAZs8U7MUhPE2yf9uqdjljIs4UN0ur+Vu0rJ52F/q8CGLv\njEuAog1OL90eYNaf/jz8LunTZzreavFRz0p2Ol/D79rq0VtauyfDOk8Wl8xf\nlFtiFKo+prDK7h24+iry+GWsYD9SK5PJObFHn6Zzuo0R21Xrc6V4aPn0QPmb\ncyTa8MSAvbwZHAawc80AnU96iwwnqvmH00fgpEYiWJpMUpC1Y3MDctYJjaWi\n6URT3menVFEP3BwHs/gOjBJdd/GGTsZcSxCPWoxwCS0wqOI+6BUeOn8OfjYq\n2dE0y4zQWZmfqndsBmdV7aU/uc9GdKU8fbQp1dHWs272PCa++XQpCO2GYUTd\nWPn6IPyInZSPCOx/OejxR9d0ITg53kJRzsYyFrTHGxc0K7BCuTrCSDxtfeD8\njbt7\r\n=0Wv9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dns-client.js","gitHead":"a37383ae817e0aca5ef41405411ad5bb41f9eb4b","scripts":{"test":"set SERVER_ENVIRONMENT=local && node dns-client.js"},"_npmUser":{"name":"acastellon","email":"antonio@castellon.ch"},"repository":{"url":"git+https://github.com/antonio-castellon/module-dns-client.git","type":"git"},"_npmVersion":"6.4.1","description":"DNS Client system for WS","directories":{},"_nodeVersion":"10.15.0","dependencies":{"@acastellon/rest":"^1.0.5"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dns-client_1.0.0_1572258431101_0.1793113692928756","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@acastellon/dns-client","version":"1.0.1","keywords":["dns","ws","rest"],"author":{"name":"Antonio Castellon"},"license":"MIT","_id":"@acastellon/dns-client@1.0.1","maintainers":[{"name":"acastellon","email":"antonio@castellon.ch"}],"homepage":"https://github.com/antonio-castellon/module-dns-client#readme","bugs":{"url":"https://github.com/antonio-castellon/module-dns-client/issues"},"dist":{"shasum":"33213ca63081ff9cc80f283e9f7e6b9a46f5e78b","tarball":"https://registry.npmjs.org/@acastellon/dns-client/-/dns-client-1.0.1.tgz","fileCount":6,"integrity":"sha512-ak7mzqC1rtEjF55kymOqTlE3veb0kywa27ElnlaJS9zmHYJWZzP81KogBu7GYB5jFRNX7uwQH51qFmzg3Cytxw==","signatures":[{"sig":"MEQCIB2iuZiWu2qjHOAWA+x81b4VoDUojthQo0GcsW3yp1thAiA63DUGtjM+VGI1Z5DRAatNBgcUY+xRnztGAKeWw1Jf8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdtsO8CRA9TVsSAnZWagAAnHsP/iP565uuwAOiRa+DUIPJ\n6fbKWBpxt1gbiV2nShKApI/CZsg+vp933V8u8q1uW/GrCOkNUD/Rn/jnXM8d\nHo96tpnQJWv3+cWHoHuUOhwTpnS4WTIRaKw7j3JEGYef9przbIbzeDkuhq4D\nGuANEJZ8dBCcrT6UtysiOiaOaweJvl9/wi4ExyweLX21qUFYOAHCsnHUUSd9\nm/XB1bk6tcFsaiiIIJosf+0p3jH/oW/6+BE16LkgrniF6zQQ/TeQC1yQVx61\nT3O+mTUFhT03bhXCSJvC2O4am6erlfhQygdzDFZfxv90bW9/K62D03lsvh45\nsghDD1211AZWzbIPTyLADTXcMYTj3T5rj7l64KlrU6gTPXkCTKz48uDU6sTl\noTOsyRa0j1GeQMDSkIDk0WqXdhRUB9fQp5gcVUnGmr6Y39iX4j3aThJrKXAJ\nnyaEm3nM9BukxfNbHB5YiQcIXraU073JVrYZjQ9WLbzuDZTDKCbiECdRnhHk\nCwA8sXg8fKxdPjWGqksE5wVZmapPVBYhFYbhKTJbJOoXNE3QKSv1BhNqDMMm\nCdYTuwDcj1CaZL0wv1MMlGd/32LiduaMD20G7Uyb5zlx7Xn8u8MjSuIogALn\nMf5fPc9GJvMN6kI0imgjHHKdfVkgvseSOEXBlkwOQfg44wOz3VCkU9ozKTJo\n5WQQ\r\n=p8jl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dns-client.js","gitHead":"a7e5a1fd12a0f5a7c07c978abb56818df1a331d6","scripts":{"test":"set SERVER_ENVIRONMENT=local && node dns-client.js"},"_npmUser":{"name":"acastellon","email":"antonio@castellon.ch"},"repository":{"url":"git+https://github.com/antonio-castellon/module-dns-client.git","type":"git"},"_npmVersion":"6.4.1","description":"DNS Client system for WS","directories":{},"_nodeVersion":"10.15.0","dependencies":{"@acastellon/rest":"^1.0.5"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dns-client_1.0.1_1572258748278_0.9402905536517168","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@acastellon/dns-client","version":"1.0.2","keywords":["dns","ws","rest"],"author":{"name":"Antonio Castellon"},"license":"MIT","_id":"@acastellon/dns-client@1.0.2","maintainers":[{"name":"acastellon","email":"antonio@castellon.ch"}],"homepage":"https://github.com/antonio-castellon/module-dns-client#readme","bugs":{"url":"https://github.com/antonio-castellon/module-dns-client/issues"},"dist":{"shasum":"8bcef01b9d2047b2be806940114d579d9b04e686","tarball":"https://registry.npmjs.org/@acastellon/dns-client/-/dns-client-1.0.2.tgz","fileCount":6,"integrity":"sha512-RMUui2n1JJLs8TWurN+ksMZys5fWDGPHT42FBThbPQ1Y3i8zSI2WDOChZUoV6HWEyBxtN+RmEaMSV1JBkA3aTw==","signatures":[{"sig":"MEYCIQCcyCOnBAnIGcTr5cnO35sgQjczqc4DzBN4XStvUBg8YQIhAI8J7/rbNbhoKf2KkrYIq0cE07yM6Rm2cCYf4G2SPuAQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdtumiCRA9TVsSAnZWagAA+QoP+wcjpLjy3gd7YdVttigD\n0FcYeKaj3iQiMRzk18uk3jyKhQZ7pgiUJ/+R/WcSk8+MnebJkCrvNjAshNDs\ntgx2J8heGhvmlC6HU4x9LndZLvRYy/6cufMASyRLClZdwR+fidOJ+0jK4jsP\nRw/RJTx6Aksoi6eTT244mxX4guGH0OolhC2UJE3Ps6zWXDg+5axu5hzEmdU9\nL2FKMc6PAQjdRFXLeNzJZqAXmFJjfCd/1jGwfY56cJNS0vE2YO2CP1IxezBx\nEXPxlA800y3W3kvaMO31cn+qOZbAzA61pc5B4AzOVmHfWgUQNCa7zFEny65W\niDijdNNYK8U4wMR6jTYyJj+2Zhmp8bMpTWKSpqWxhHrDTTJBUCS8oGOowWo9\nCXcBvE00QAp5o47p0rqTQaT75bHxGVLmKs2CzX3A/AzKry9BGT3ieAw8ZxOk\nPDzT/k42B4obWtk8EsLy27LpIVAkWXDGc4Ra3vybrNMm5xrTeVxYgqJeHzCL\ndSWWevz5LhXJYoKg9dhdu6R9n5LRgeYA2qpaArRBRtqR2biKk5VGUM0fH09c\n4SnjpxjAHcKl30U5/Ibu4dRqaIMDUdAln9wVodLbVsfa81++8ZbOE/Jw93W0\nS1roaABSvkfWhFWbM1sPN15HJsG5JS0uwEpvNwQnfLSbumOZ6Sp6NEsWVH/Q\nMkLy\r\n=1W1I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dns-client.js","gitHead":"4086296863a8b8c8826b5b25cb2c3745922720c3","scripts":{"test":"set SERVER_ENVIRONMENT=local && node dns-client.js"},"_npmUser":{"name":"acastellon","email":"antonio@castellon.ch"},"repository":{"url":"git+https://github.com/antonio-castellon/module-dns-client.git","type":"git"},"_npmVersion":"6.4.1","description":"DNS Client system for WS","directories":{},"_nodeVersion":"10.15.0","dependencies":{"@acastellon/rest":"^1.0.5"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dns-client_1.0.2_1572268450340_0.6570731273256933","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@acastellon/dns-client","version":"1.0.3","keywords":["dns","ws","rest"],"author":{"name":"Antonio Castellon"},"license":"MIT","_id":"@acastellon/dns-client@1.0.3","maintainers":[{"name":"acastellon","email":"antonio@castellon.ch"}],"homepage":"https://github.com/antonio-castellon/module-dns-client#readme","bugs":{"url":"https://github.com/antonio-castellon/module-dns-client/issues"},"dist":{"shasum":"fb0029a3f0fafc11457fdcedf0c6dff33eadf839","tarball":"https://registry.npmjs.org/@acastellon/dns-client/-/dns-client-1.0.3.tgz","fileCount":6,"integrity":"sha512-HMooABJ69WRDxFXZF/oVO9LDYe5oUdjOrem4K+feHg3Xc0i1nvMisrKo4oyz22ksc851yJ7TWSoPMslJl/dhuA==","signatures":[{"sig":"MEUCIB3Xj78uQ0++SDmEtxTzK/omO4WqhkOt1uJmK2sFtHU/AiEAjw/9nz49i+xqO2Y4BjLW/MumIHMWI0M/0TdfmtErMWo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9622,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdtusqCRA9TVsSAnZWagAA46wP/140Fsc8/hun60//Dxl+\n/sviBZxjFKd8pwSzFOZwZjXMBQPUjej4d1/6JClOG/6RDBh9MgRY/ucZLYr+\ntrpb9lUZCS2v6oAVa6jzjx/hrYdicOGa8Nt7Ltz82bXOWefMj2H/gIzQ4y6P\ngOUNu2K7LZze02pmx0xzMd5+Z3gWhXXDlpJ2DMeUYA4c0n/DVByNTwjK6Npo\ni503MeJfV5snwJaK4GrSEzbUzwjZ6Xm3W7QpICyabwhBPzLpylKsaPlJF85d\n2mKtRZOROIudG52/JwOmGE+lY+i7rEi9/iBEoYXZ+6W4VBNe7LfTs9PULu3W\ng6l+Y36oO4opKKtLqUvPBISXY6q/GPSPId8iClYAsUmoym5w0QlLoJPnaJGB\n/yL6ybSqAaygj2wavBwnyzB2H+QfMJ8wj5me0MfDtO+7TvEJuezd3+Dmf2BB\nYx0QZ3nyTmDPiEdm1Jki+Pyjh4JxS4p+FWtWRqKEoYgfyPUlDA3hTtsp/p7N\nUu8ujPpGsZmFH4A+IWPqTUGbuhBqmgmX7Vky/43VBYGhaYO3NwrW2cjgdQLR\nW+XJ2j5GhtHf4qPTlKAHpLdZynOdYkHxO9pN0z4NE9eDnjXmHJHfdYMhXOMQ\nl0HJXA/GhHkDgGyjCok0JZljfIMR1zZFhveq/fISN67udT4UMzcQOtVK7rjR\nkuu+\r\n=1E3I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dns-client.js","gitHead":"23ddb60c8484cd971ed2052d787ee736c594c9b3","scripts":{"test":"set SERVER_ENVIRONMENT=local && node dns-client.js"},"_npmUser":{"name":"acastellon","email":"antonio@castellon.ch"},"repository":{"url":"git+https://github.com/antonio-castellon/module-dns-client.git","type":"git"},"_npmVersion":"6.4.1","description":"DNS Client system for WS","directories":{},"_nodeVersion":"10.15.0","dependencies":{"@acastellon/rest":"^1.0.5"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dns-client_1.0.3_1572268842502_0.4493420754171529","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"@acastellon/dns-client","version":"1.2.0","keywords":["dns","ws","rest"],"author":{"name":"Antonio Castellon"},"license":"MIT","_id":"@acastellon/dns-client@1.2.0","maintainers":[{"name":"acastellon","email":"antonio@castellon.ch"}],"homepage":"https://github.com/antonio-castellon/module-dns-client#readme","bugs":{"url":"https://github.com/antonio-castellon/module-dns-client/issues"},"dist":{"shasum":"03ce37574122afcf94172f67863bb1881b4fe47f","tarball":"https://registry.npmjs.org/@acastellon/dns-client/-/dns-client-1.2.0.tgz","fileCount":6,"integrity":"sha512-VnRgD0Htux0z/h0gS4FGYX7zsPGND3H7MMZupG/FiDycgFEwM/b2xK20q3szIwySfP0JATvLdZVStOjIptPdOg==","signatures":[{"sig":"MEUCIQCdwYrdYK5WVdImDbvBgQ8TcdM8uXbgiipwivkqr4XLfAIgXV0sxnkA/XfLlmrWsABvHfPOsO/CalRqawtux1+GwdQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9991},"main":"dns-client.js","engines":{"node":">=18.0.0"},"gitHead":"fdf51e3671e139d8778171de5187863f900d9eff","scripts":{"test":"node test.js"},"_npmUser":{"name":"acastellon","email":"antonio@castellon.ch"},"repository":{"url":"git+https://github.com/antonio-castellon/module-dns-client.git","type":"git"},"_npmVersion":"10.9.2","description":"DNS Client system for WS","directories":{},"_nodeVersion":"22.14.0","dependencies":{"node-fetch":"^2.6.9","@acastellon/rest":"^1.3.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dns-client_1.2.0_1780483706069_0.39451244752040493","host":"s3://npm-registry-packages-npm-production"}},"1.3.1":{"name":"@acastellon/dns-client","version":"1.3.1","description":"DNS Client system for WS","main":"dns-client.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git+https://github.com/antonio-castellon/module-dns-client.git"},"keywords":["dns","ws","rest"],"dependencies":{"@acastellon/rest":"^1.3.2","node-fetch":"^2.6.9"},"author":{"name":"Antonio Castellon"},"license":"MIT","bugs":{"url":"https://github.com/antonio-castellon/module-dns-client/issues"},"homepage":"https://github.com/antonio-castellon/module-dns-client#readme","engines":{"node":">=18.0.0"},"_id":"@acastellon/dns-client@1.3.1","gitHead":"027644a32a38c7a15504e68f8e42c565547cd7f0","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-3xpvPsgmve381LC8y9Y+mvHlinhbVhxT0uuLvjlNkkGdanAk7AXH/R6Zu00Yw9VorR5PY9Q2+YHrrMZrVWUxlA==","shasum":"af8bf8968ba1e1b7035c15b88b4cc35277d6cfff","tarball":"https://registry.npmjs.org/@acastellon/dns-client/-/dns-client-1.3.1.tgz","fileCount":6,"unpackedSize":11481,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDq6gB02cDkpHB0LyaPAMeAF5ulmhxp6HYNb7f//Q0ysAiEAtYzjL2KMSheGCup2vT7h5nqz5OJ79y+6kjZ0ZKmu6rM="}]},"_npmUser":{"name":"acastellon","email":"antonio@castellon.ch"},"directories":{},"maintainers":[{"name":"acastellon","email":"antonio@castellon.ch"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dns-client_1.3.1_1781761852714_0.6196301265130062"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-28T10:27:10.858Z","modified":"2026-06-18T05:50:52.995Z","1.0.0":"2019-10-28T10:27:11.289Z","1.0.1":"2019-10-28T10:32:28.407Z","1.0.2":"2019-10-28T13:14:10.502Z","1.0.3":"2019-10-28T13:20:42.610Z","1.2.0":"2026-06-03T10:48:26.210Z","1.3.1":"2026-06-18T05:50:52.873Z"},"bugs":{"url":"https://github.com/antonio-castellon/module-dns-client/issues"},"author":{"name":"Antonio Castellon"},"license":"MIT","homepage":"https://github.com/antonio-castellon/module-dns-client#readme","keywords":["dns","ws","rest"],"repository":{"type":"git","url":"git+https://github.com/antonio-castellon/module-dns-client.git"},"description":"DNS Client system for WS","maintainers":[{"name":"acastellon","email":"antonio@castellon.ch"}],"readme":"# @acastellon/dns-client\r\n\r\nDNS Client object to manage the discovery of new services addresses (ad-hoc WS discovery).\r\n\r\nWorks with a companion WS DNS server (see module-ws-dns).\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install @acastellon/dns-client\r\n```\r\n\r\n## Config\r\n\r\nDNS_SERVER_URL can be string or array of URLs. Uses node-fetch + https.Agent for cert validation control.\r\n\r\n```js\r\nmodule.exports = {\r\n  VERSION: 'v1',\r\n  VALIDATE_CERTIFICATES: false,\r\n  DNS_SERVER_URL: [\r\n    'https://127.0.0.1:7770',\r\n    'https://127.0.0.1:7777'\r\n  ]\r\n};\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\nconst config = require('./config.dns.js');\r\nconst client = require('@acastellon/dns-client')(config);\r\n\r\nawait client.dnsRefresh();\r\nawait client.registerService('myservice', 'https://', 7000, 'GET');\r\nconst addr = await client.getServiceAddress('myservice');\r\n```\r\n\r\n## API\r\n\r\n### dnsRefresh(): Promise<string[]>\r\n\r\nRefreshes the list of reachable DNS servers (removes unreachable).\r\n\r\n**Example (with minimal setup):**\r\n\r\n```js\r\nconst config = require('./config.dns.js');\r\nconst client = require('@acastellon/dns-client')(config);\r\n\r\nconst active = await client.dnsRefresh();\r\nconsole.log('Active DNS servers:', active);\r\n```\r\n\r\n### registerService(service_id, PROTOCOL, PORT, METHOD): Promise<boolean>\r\n\r\nRegisters with all (remaining) active DNS servers.\r\n\r\n**Example (with minimal setup):**\r\n\r\n```js\r\nconst config = require('./config.dns.js');\r\nconst client = require('@acastellon/dns-client')(config);\r\n\r\nconst registered = await client.registerService('myservice', 'https://', 7000, 'GET');\r\nconsole.log('Registered:', registered);\r\n```\r\n\r\n### getServiceAddress(service_id): Promise<{service?: {PROTOCOL, IP_OR_CNAME, PORT, METHOD}, error?: string}>\r\n\r\n**Example (with minimal setup):**\r\n\r\n```js\r\nconst config = require('./config.dns.js');\r\nconst client = require('@acastellon/dns-client')(config);\r\n\r\nconst addr = await client.getServiceAddress('myservice');\r\nif (addr.service) {\r\n  console.log('Service at:', addr.service);\r\n} else {\r\n  console.log('Error:', addr.error);\r\n}\r\n```\r\n\r\n### getServiceData(service_id, service_path, [jObject]): Promise<{data?: any, error?: string}>\r\n\r\n**Example (with minimal setup):**\r\n\r\n```js\r\nconst config = require('./config.dns.js');\r\nconst client = require('@acastellon/dns-client')(config);\r\n\r\nconst data = await client.getServiceData('myservice', '/api/foo', { bar: 1 });\r\nconsole.log('Data:', data);\r\n```\r\n\r\nInternally caches service addresses.\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}