diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c845a8d801fc..00531cba7ffcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: matrix: # Include all major maintenance + active LTS + current Node.js versions. # https://github.com/nodejs/Release#release-schedule - node: [14, 16] + node: [14, 16, 18] steps: - name: Checkout uses: actions/checkout@v3 diff --git a/src/node/NodeWebSocketTransport.ts b/src/node/NodeWebSocketTransport.ts index 78a60781e6a8b..4d5e70e4aa5c7 100644 --- a/src/node/NodeWebSocketTransport.ts +++ b/src/node/NodeWebSocketTransport.ts @@ -16,9 +16,14 @@ import NodeWebSocket from 'ws'; import { ConnectionTransport } from '../common/ConnectionTransport.js'; import { packageVersion } from '../generated/version.js'; +import { promises as dns } from 'dns'; export class NodeWebSocketTransport implements ConnectionTransport { - static create(url: string): Promise { + static async create(urlString: string): Promise { + const url = new URL(urlString); + const { address } = await dns.lookup(url.hostname, { verbatim: false }); + url.hostname = address; + return new Promise((resolve, reject) => { const ws = new NodeWebSocket(url, [], { followRedirects: true,