}
catch (MalformedURLException e1)
{
e1.printStackTrace();
}
proxyTunnel.addListener(new ChannelFutureListener()
{
public void operationComplete(ChannelFuture future)
throws Exception
{
if (!future.isSuccess())
{
byte[] failed = "HTTP/1.1 503 Service Unavailable\r\n\r\n"
.getBytes();
local.handleRawData(GoogleRemoteHandler.this,
ChannelBuffers.wrappedBuffer(failed));
}
else
{
ChannelPipeline pipeline = future.getChannel()
.getPipeline();
pipeline.addLast("encoder",
new HttpRequestEncoder());
future.getChannel().write(req);
}
}
});
}
else
{
String remoteHost = HostsService
.getMappingHost(GoogleConfig.googleHttpsHostAlias);
proxyTunnel = SharedObjectHelper.getClientBootstrap().connect(
new InetSocketAddress(remoteHost, 443));
proxyTunnel.addListener(new ChannelFutureListener()
{
public void operationComplete(ChannelFuture future)
throws Exception
{
if (future.isSuccess())