title: How to set proxy for Spring AsyncRestTemplate using Netty4ClientHttpRequestFactory?
body: <p>When I use a SimpleRequestFactory with my AsyncRestTemplate I can easily configure an HTTP proxy server.</p>
  
  <p>I can either do (sample code in Kotlin):</p>
  
  <pre><code>@Bean
  open fun asyncRestTemplate(): AsyncRestTemplate {
      val proxy = Proxy(Proxy.Type.HTTP, InetSocketAddress("127.0.0.1", 8008))
  
      val requestFactory = SimpleClientHttpRequestFactory().apply {
          this.setConnectTimeout(TimeUnit.SECONDS.toMillis(10).toInt())
          this.setReadTimeout(TimeUnit.SECONDS.toMillis(10).toInt())
          this.setProxy(proxy)
          this.setTaskExecutor(taskExecutor())
      }
  
      return AsyncRestTemplate(requestFactory)
  }
  </code></pre>
  
  <p>Or I can simply set the corresponding system properties: <code>-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8008</code>.</p>
  
  <p>However, in the moment that I switch from the <code>SimpleClientHttpRequestFactory</code> to a <code>Netty4ClientHttpRequestFactory</code> there is no evident way to configure the proxy directly and it seems this client does not respect the system properties either.</p>
  
  <pre><code>val requestFactory = Netty4ClientHttpRequestFactory().apply {
      this.setConnectTimeout(TimeUnit.SECONDS.toMillis(10).toInt())
      this.setReadTimeout(TimeUnit.SECONDS.toMillis(10).toInt())
      //this.setProxy(proxy) //???
  }
  </code></pre>
  
  <p>Once I change for the netty client, I have no clue on how to make it go through the proxy.  </p>
  
  <p>My interest in using the netty client was that I not only wanted to make async requests, but also I wanted this to be non-blocking. I hope I'm not making a wrong assumption here.</p>
  
  <p>Does anyone know how can I use a proxy server when using the <code>Netty4ClientHttpRequestFactory</code> or perhaps know of an alternative non-blocking client supported by Spring that I could use?</p>