microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.5k stars 2.44k forks source link

[DCR] Add proxy support to the sdk #5469

Closed EricDahlvang closed 4 years ago

EricDahlvang commented 5 years ago

Issue

Some bots are hosted in environments where a proxy is required or preferred. While developers can specify a proxy for their own specific external calls, the framework itself also needs to be able to utilize a proxy server so that all requests, including connector services, qna maker, luis, authentication (openid metadata, etc) will be routed to the proxy server.

The solution should be similar across sdk languages and easy to configure, with all external calls should automatically use the proxy.

Tracking Status

Dotnet SDK Add proxy support https://github.com/microsoft/botbuilder-dotnet/issues/2281

Javascript SDK [Botframework-Connector] Proxy Settings are Ignored https://github.com/microsoft/botbuilder-js/issues/717

Java SDK Add proxy support https://github.com/microsoft/botbuilder-java/issues/81

Python SDK Add Proxy support https://github.com/microsoft/botbuilder-python/issues/263

Docs Add docs explaining how to use a proxy with each of the sdk languages.

[dcr]

dmvtech commented 5 years ago

Regarding .NET:

Looks like this will be available in .NET core 3.0 in one single spot (similar to how we can do it in .NET Framework currently).

More info: https://stackoverflow.com/questions/42637592/asp-net-core-defaultproxy

I think it best if we can just use proxy settings at the application level, so that we don't have to manage it otherwise. I don't know whether it's worth it to wait for 3.0 for .NET core, but it definitely would be worthwhile to ensure any httpClient/similar objects inside the SDK would use the 'globally' assigned proxies from the application level.

cleemullins commented 5 years ago

Unless I mis-remember, the current C# SDK (4.5.X) supports a Proxy Server.

EricDahlvang commented 5 years ago

It is possible to use a proxy with 4.5.x, but the support for it could be simplified. Maybe app settings based, rather than the current code changes required. Also, the dotnet sdk could be using HttpClientFactory with named httpclients for the places we are currently creating httpclients.

ChupaCabre commented 4 months ago

Hi @EricDahlvang @gabog is there proxy support for the javascript SDK at this point? If so, how are the proxy settings passed into the CloudAdapter? I've looked through the docs & samples but I don't see any mention of proxies.