localSocks5Server.allowedAddresses.add(hash);
try {
// 5.3.1 Requester Initiates S5B Negotiation
// 6.3.1 Requester Initiates S5B Negotiation
IQ result = xmppSession.query(new IQ(target, IQ.Type.SET, new Socks5ByteStream(sessionId, streamHosts, hash)));
// 5.3.3 Target Acknowledges Bytestream
// 6.3.3 Target Acknowledges Bytestream
Socks5ByteStream socks5ByteStream = result.getExtension(Socks5ByteStream.class);
StreamHost usedStreamHost = null;
for (StreamHost streamHost : streamHosts) {
if (socks5ByteStream.getStreamHostUsed() != null && socks5ByteStream.getStreamHostUsed().equals(streamHost.getJid())) {
usedStreamHost = streamHost;
break;
}
}