-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ConnectorClientOptions to BotFrameworkAdapterSettings #2013
Comments
Edit: This would also get us proxy support and httpClient injection, so I'm all for this. I believe passing it in via BotFrameworkAdapterSettings should suffice, what do you think @EricDahlvang? private createConnectorClientInternal(serviceUrl: string, credentials: AppCredentials): ConnectorClient {
// Helper method for deep clone and setting of serviceUrl and combining/setting USER_AGENT
// Clones/creates ClientOptions from BotFrameworkAdapter.settings.clientOptions,
// a new property with a type of ServiceClientOptions
const clientOptions = this.cloneOrCreateClientOptions(serviceUrl);
if (BotFrameworkAdapter.isStreamingServiceUrl(serviceUrl)) {
// Check if we have a streaming server. Otherwise, requesting a connector client
// for a non-existent streaming connection results in an error
if (!this.streamingServer) {
throw new Error(`Cannot create streaming connector client for serviceUrl ${ serviceUrl } without a streaming connection. Call 'useWebSocket' or 'useNamedPipe' to start a streaming connection.`);
}
clientOptions.httpClient = clientOptions.httpClient || new StreamingHttpClient(this.streamingServer);
return new ConnectorClient(credentials, clientOptions);
}
return new ConnectorClient(credentials, clientOptions);
} |
Using diffchecker, I compared the released 1.2.6 ServiceClientOptions with what's in
Guarding against |
I don't think we can go to 2.0, due to the axios-based to node-fetch change. This would be breaking, since developers are potentially customizing axios in their bot code right now. |
I'm not advocating for going to 2.0 and I'm aware of that change. The screenshots are a snippet indicating what the ServiceClientOptions delta is. |
Describe the solution you'd like
The ability to set
ServiceClientOptions
when ConnectorClients are createdDescribe alternatives you've considered
Hacking the
createConnectorClientInternal
method prototype onBotFrameworkAdapter
, and accessing the ConnectorClient's properties directly:[enhancement]
The text was updated successfully, but these errors were encountered: