throw new IOException("Failed to establish a connection through HTTP proxy: "+rsp);
// HTTP proxies (at least the one I tried --- squid) doesn't seem to do half-close very well.
// So instead of relying on it, we'll just send the close command and then let the server
// cut their side, then close the socket after the join.
out = new SocketOutputStream(s) {
@Override
public void close() throws IOException {
// ignore
}
};
} else {
s = new Socket();
s.connect(endpoint,3000);
out = new SocketOutputStream(s);
}
closables.add(new Closeable() {
public void close() throws IOException {
s.close();