-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[FEATURE REQ] Enable Multi-Proxy Support in Track 2 Azure.Core #5372
Comments
PR #5387 adds documentation and samples on how to configure a proxy for both HttpClient implementations that we have plugin packages for, does this help resolve the multi-proxy support issue? |
@alzimmermsft It's a good start, but we need an example of 2 unrelated sdks in a sample application using 2 different authenticated proxies (digest and basic authenticated proxy). /cc @amishra-dev |
This is an ask from one of our customers too, who don't want a global proxy configuration. Track 1 Event Hubs has the concept of a ProxyConfiguration that people can pass when creating the client. This also exists in Track 2 Event Hubs. |
@jianghaolu can you please prioritize this for the November preview release? |
Maybe I'm missing something here but why not just create another HttpClient with a different proxy setup? |
This may already be supported in Track 2, just have to ensure it works. In Track 1 storage libraries, they use HttpURLConnection, which only supports the global proxy configuration. |
Just following up here -- we should create a quick sample showing Digest and Basic Authenticated Proxy working on Track 2. If there are any feature gaps in Azure.Core around Digest then we should open up additional tracking items to complete this work in an upcoming monthly SDK update. |
@joshfree, samples is a good idea (just showing how to do 2 pipelines with 2 proxies). And as long as we can confirm internally that it works and we can integrate this with eventhub, I think we are good. |
this is a simple example of talking to Key vault and Storage using different proxies: public class Main {
private static final ProxyOptions proxy1 = new ProxyOptions(ProxyOptions.Type.HTTP,
new InetSocketAddress("10.127.70.25", 8085))
.setCredentials("azureuser", "StrongPass!123");
private static final ProxyOptions proxy2 = new ProxyOptions(ProxyOptions.Type.HTTP,
new InetSocketAddress("10.127.70.25", 8888));
public static void main(String... args) throws Exception {
InteractiveBrowserCredential credential1 = new InteractiveBrowserCredentialBuilder()
.clientId("<client id>")
.port(8765)
.build();
InteractiveBrowserCredential credential2 = new InteractiveBrowserCredentialBuilder()
.clientId("<client id>")
.port(8765)
.proxyOptions(proxy2)
.build();
NioEventLoopGroup sharedElg = new NioEventLoopGroup();
HttpClient client1 = new NettyAsyncHttpClientBuilder()
.proxy(proxy1)
.nioEventLoopGroup(sharedElg)
.build();
HttpClient client2 = new NettyAsyncHttpClientBuilder()
.proxy(proxy2)
.nioEventLoopGroup(sharedElg)
.build();
SecretClient secretClient = new SecretClientBuilder()
.httpClient(client1)
.credential(credential1)
.vaultUrl("https://{vault name}.vault.azure.net")
.buildClient();
KeyVaultSecret secret = secretClient.getSecret("the-secret");
System.out.println(secret.getId() + ": " + secret.getValue());
BlobServiceClient blobServiceClient = new BlobServiceClientBuilder()
.httpClient(client2)
.credential(credential2)
.endpoint("https://{storage account}.blob.core.windows.net/")
.buildClient();
System.out.println(blobServiceClient.listBlobContainers().stream().count());
}
} Note that AAD login does not support proxy authentication yet. |
This is great @jianghaolu. thanks for getting this together. Do you want to put this in a wiki page? or if you want I can do that. Thanks again. |
reassigning this to @alzimmermsft to follow up with wiki documentation as part of closing this issue. |
Closing as this wiki adds guidelines on how to configure a proxy on |
Is your feature request related to a problem? Please describe.
Some customers expect to run in an environment with a global proxy setting. Our Track 2 SDKs should be able to have a proxy setting independent of that and not overwrite the global setting.
Describe the solution you'd like
The ability to have multi-proxy support so that no connection can overwrite the proxy settings for another connection.
Additional context
This is a feature request we should investigate for Preview 4
The text was updated successfully, but these errors were encountered: