diff --git a/CHANGELOG.md b/CHANGELOG.md index b7e6c047..a1805b8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ The minor version will be incremented upon a breaking change and the patch versi ### Fixes +- nodejs: fix connector for custom port ([#488](https://github.com/rpcpool/yellowstone-grpc/pull/48*)) + ### Features - proto: add tonic feature ([#474](https://github.com/rpcpool/yellowstone-grpc/pull/474)) diff --git a/examples/typescript/package-lock.json b/examples/typescript/package-lock.json index 107c085d..00fef9f3 100644 --- a/examples/typescript/package-lock.json +++ b/examples/typescript/package-lock.json @@ -19,7 +19,7 @@ }, "../../yellowstone-grpc-client-nodejs": { "name": "@triton-one/yellowstone-grpc", - "version": "1.3.0", + "version": "1.3.1", "license": "Apache-2.0", "dependencies": { "@grpc/grpc-js": "^1.8.0" diff --git a/yellowstone-grpc-client-nodejs/package-lock.json b/yellowstone-grpc-client-nodejs/package-lock.json index ddf87547..f930567f 100644 --- a/yellowstone-grpc-client-nodejs/package-lock.json +++ b/yellowstone-grpc-client-nodejs/package-lock.json @@ -1,12 +1,12 @@ { "name": "@triton-one/yellowstone-grpc", - "version": "1.3.0", + "version": "1.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@triton-one/yellowstone-grpc", - "version": "1.3.0", + "version": "1.3.1", "license": "Apache-2.0", "dependencies": { "@grpc/grpc-js": "^1.8.0" diff --git a/yellowstone-grpc-client-nodejs/package.json b/yellowstone-grpc-client-nodejs/package.json index b9afff84..771e4c20 100644 --- a/yellowstone-grpc-client-nodejs/package.json +++ b/yellowstone-grpc-client-nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@triton-one/yellowstone-grpc", - "version": "1.3.0", + "version": "1.3.1", "license": "Apache-2.0", "author": "Triton One", "description": "Yellowstone gRPC Geyser Node.js Client", diff --git a/yellowstone-grpc-client-nodejs/src/index.ts b/yellowstone-grpc-client-nodejs/src/index.ts index 27b385a7..10d3b61e 100644 --- a/yellowstone-grpc-client-nodejs/src/index.ts +++ b/yellowstone-grpc-client-nodejs/src/index.ts @@ -101,6 +101,15 @@ export default class Client { let creds: ChannelCredentials; const endpointURL = new URL(endpoint); + let port = endpointURL.port; + if (port == "") { + switch (endpointURL.protocol) { + case "https:": + port = "443"; + case "http:": + port = "80"; + } + } // Check if we need to use TLS. if (endpointURL.protocol === "https:") { @@ -121,7 +130,11 @@ export default class Client { } } - this._client = new GeyserClient(endpointURL.host, creds, channelOptions); + this._client = new GeyserClient( + `${endpointURL.host}:${port}`, + creds, + channelOptions + ); } private _getInsecureMetadata(): Metadata {