AsyncHttpClient/async-http-client — pull request #563 by artnaseef (2014-06-02 23:57:50+00:00)
Title: Support NTLM protocol with the proxy: fixed the header name for Proxy-Authorization

Support for NTLM proxies, using the Netty provider, did not appear to function due to the wrong header name being used on the second request from the client to the server in the handshake: ```Authorization``` should be ```Proxy-Authorization```.

Attached is a pull request that fixes the problem against 1.8.10-SNAPSHOT.

```
/**
* Configure the Async HTTP Client
*/
protected AsyncHttpClientConfig getConfig () {
AsyncHttpClientConfig.Builder configBuilder = new AsyncHttpClientConfig.Builder();

if ( ntlmDomain != null ) {
configBuilder
.setRealm(new Realm.RealmBuilder()
.setPrincipal(this.username)
.setPassword(this.password)
.setNtlmDomain(this.ntlmDomain)
.setUsePreemptiveAuth(true)
.build());
}

return configBuilder.build();
}

public void execute () {
AsyncHttpClientConfig config = this.getConfig();

this.client = new AsyncHttpClient(config);

try {
Future futureWebsocket;
ProxyServer proxy = new ProxyServer(this.proxyProtocol, this.proxyServer, this.proxyServerPort,
this.username, this.password);
if ( ntlmDomain != null ) {
proxy.setNtlmDomain(ntlmDomain);
}

futureWebsocket =
this.client.prepareGet(this.wsUrl)
.setProxyServer(proxy)
.execute(new WebSocketUpgradeHandler.Builder().build());

LOG.info("waiting for websocket connection");
final WebSocket websocket = futureWebsocket.get();

if ( websocket != null ) {
LOG.info("received websocket connection");

websocket.addWebSocketListener(new WebSocketTextListener() {
@Override
public void onMessage(String s) {
LOG.info("received response {}", s);
processAgentRequest(websocket, s);
}

...
}
```