title: Adding a proxy settings to Microsoft Graph Client in Java
body: <p>I am trying to implement GraphClient, below is a sample code which is working fine...</p>
  <pre><code>   ClientCredentialProvider authProvider = 
                new ClientCredentialProvider(clientId,
                        scopes,
                        clientSecret,
                        b2cTenant,
                        endpoint);
      
      IGraphServiceClient graphClient = graphClient = GraphServiceClient.builder()
                  .authenticationProvider(authProvider)
                  .buildClient();
  </code></pre>
  <p>This is working fine...but in some case from where the code is being run, there is a proxy, so I need to setup proxy to connect to internet. I need to setup proxy and pass it to graphClient somehow to tell make a call via proxy.</p>
  <p>I was trying to find a document but could not get any through I got this...</p>
  <pre><code>ProxyOptions proxyOptions = new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress(proxyUrl, proxyPort));
  proxyOptions.setCredentials(proxyUser, proxyPassword);
  
  final UsernamePasswordCredential usernamePasswordCredential = new UsernamePasswordCredentialBuilder()
                      .clientId(clientId)
                      .username(username)
                      .password(password)
                      .httpClient(HttpClient.createDefault(new HttpClientOptions().setProxyOptions(proxyOptions)))
                      .build();
  </code></pre>
  <p>But the problem is the &quot;ProxyOptions&quot; isnt in Maven and I am not sure what library it is part of.</p>
  <p>Can anyone suggest an idea.</p>