You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this code at the moment that I use to increase the frame and window sizes:
class CustomChannelCred extends ChannelCredentials {
constructor(callCredentials?: CallCredentials) {
super();
}
compose(callCredentials: CallCredentials): never {
throw new Error("Cannot compose insecure credentials");
}
_getConnectionOptions(): any {
return {
settings: {
// This will increase the http2 frame size. Default is 16384, which is too small.
maxFrameSize: 4194304,
// The initial window size set here is overridden later. We need to patch the grpc-js library to allow this.
initialWindowSize: 4194304,
maxHeaderListSize: 8192,
enablePush: false,
maxConcurrentStreams: 0,
},
};
}
_isSecure(): boolean {
return false;
}
_equals(other: ChannelCredentials): boolean {
return other instanceof CustomChannelCred;
}
}
Previously I was connecting to an upstream without SSL but that has changed. I can successfully connect to the upstream if I scrap all of that and just use credentials.createSsl(), but then I'm not setting my custom connection options. Making _isSecure return true also doesn't work.
I've tried a variety of ways to create a custom channel credentials class, composing with CallCredentials, etc. but none of that seems to work. I'm reaching for some kind of compose function that works with another instance of ChannelCredentials, but it doesn't exist.
In short, how can I modify the connection options on an instance of ChannelCredentials?
The text was updated successfully, but these errors were encountered:
banool
changed the title
How to create credentials with custom connection options?
How to create secure credentials with custom connection options?
Sep 1, 2023
Hahah yeah I could tell from the API that customizing the connection options was not really supported.
Being able to set some of those arguments would be nice indeed, consider this a +1 to the feature request! As it is now, I'm seeing that upgrading from 1.8 to 1.9 actually improves the perf issues we were seeing significantly so this doesn't seem to be a blocker for us anymore.
I have this code at the moment that I use to increase the frame and window sizes:
Previously I was connecting to an upstream without SSL but that has changed. I can successfully connect to the upstream if I scrap all of that and just use
credentials.createSsl()
, but then I'm not setting my custom connection options. Making_isSecure
return true also doesn't work.I've tried a variety of ways to create a custom channel credentials class, composing with CallCredentials, etc. but none of that seems to work. I'm reaching for some kind of
compose
function that works with another instance of ChannelCredentials, but it doesn't exist.I looked at these docs and they didn't really help either: https://grpc.io/docs/guides/auth/#nodejs.
In short, how can I modify the connection options on an instance of ChannelCredentials?
The text was updated successfully, but these errors were encountered: