{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-storage-java/issues/48","labels_url":"https://api.github.com/repos/Azure/azure-storage-java/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-storage-java/issues/48/comments","events_url":"https://api.github.com/repos/Azure/azure-storage-java/issues/48/events","html_url":"https://github.com/Azure/azure-storage-java/issues/48","id":100226130,"number":48,"title":"Connecting to Azure storage account throw HTTP proxy","user":{"login":"ramanh3","id":7115218,"avatar_url":"https://avatars.githubusercontent.com/u/7115218?v=3","gravatar_id":"","url":"https://api.github.com/users/ramanh3","html_url":"https://github.com/ramanh3","followers_url":"https://api.github.com/users/ramanh3/followers","following_url":"https://api.github.com/users/ramanh3/following{/other_user}","gists_url":"https://api.github.com/users/ramanh3/gists{/gist_id}","starred_url":"https://api.github.com/users/ramanh3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramanh3/subscriptions","organizations_url":"https://api.github.com/users/ramanh3/orgs","repos_url":"https://api.github.com/users/ramanh3/repos","events_url":"https://api.github.com/users/ramanh3/events{/privacy}","received_events_url":"https://api.github.com/users/ramanh3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-08-11T04:56:37Z","updated_at":"2015-09-24T11:24:24Z","closed_at":null,"body":"In Azure Storage SDK for Java version setting http proxy is not provided directly by the API. \r\nIt looks like the only way you can specify the proxy is by setting the Java System properties:\r\nhttp(S).proxyHost, http(s).proxyPort see [here] (http://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html) the proxy section.\r\n\r\nAs those are system level properties they will affect any client trying to connect any http(s) service running from the same JVM. In case you would like some of the clients to access the service directly you can specify the http.nonProxyHosts.\r\n\r\nThis methods has few drawbacks\r\n1. Figuring out all the services that need to be accessed without a proxy maybe hard and even harder to maintain\r\n2. Using different Proxies to different services is impossible \r\n\r\nI suggest the following changes to the API to allow usage of proxy.\r\n\r\nAdding proxy to the Client constructor\r\n```\r\nURI uri = new URI(\"http://account.blob.core.windows.net\"); \r\nStorageCredentials credentials = new StorageCredentialsAccountAndKey(\"account\", \"xyz==\")\r\nProxy httpProxy = new Proxy(Proxy.Type.HTTP,new InetSocketAddress(\"squid.address.com\",3128))\r\nCloudBlobClient blobClient = new CloudBlobClient(uri,credentials,httpProxy);\r\n ``` \r\nAdding proxy to connection string \r\n\r\n```\r\npublic static final String storageConnectionString = \"DefaultEndpointsProtocol=https;\"\r\n\t\t\t         + \"AccountName=account;\"\r\n\t\t\t         + \"BlobEndpoint=https://account.blob.core.windows.net;\"\r\n\t\t\t         + \"AccountKey=xyz==\";\r\n\t           \t\t + \"StorageProxyUri=squid.address.com:3128\";\r\n\t           \t\t + \"StorageProxyUriUsername=user\";\r\n\t           \t\t + \"StorageProxyUriPassword=secret\";\r\n\t\t \r\nCloudStorageAccount  account = CloudStorageAccount.parse(\"storageConnectionString\");\r\nCloudBlobClient blobClient = account.createCloudBlobClient();\r\n\r\n``` "},"comment":{"url":"https://api.github.com/repos/Azure/azure-storage-java/issues/comments/142901428","html_url":"https://github.com/Azure/azure-storage-java/issues/48#issuecomment-142901428","issue_url":"https://api.github.com/repos/Azure/azure-storage-java/issues/48","id":142901428,"user":{"login":"shaikap","id":10546201,"avatar_url":"https://avatars.githubusercontent.com/u/10546201?v=3","gravatar_id":"","url":"https://api.github.com/users/shaikap","html_url":"https://github.com/shaikap","followers_url":"https://api.github.com/users/shaikap/followers","following_url":"https://api.github.com/users/shaikap/following{/other_user}","gists_url":"https://api.github.com/users/shaikap/gists{/gist_id}","starred_url":"https://api.github.com/users/shaikap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaikap/subscriptions","organizations_url":"https://api.github.com/users/shaikap/orgs","repos_url":"https://api.github.com/users/shaikap/repos","events_url":"https://api.github.com/users/shaikap/events{/privacy}","received_events_url":"https://api.github.com/users/shaikap/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T11:24:24Z","updated_at":"2015-09-24T11:24:24Z","body":"I also need this feature. How can I set the proxy using OperationContext?"}}