/*
* build a SOCKS5 stream host info for "proxy2.xmpp-server" containing the address and the
* port of the proxy
*/
Bytestream streamHostInfo1 = Socks5PacketUtils.createBytestreamResponse(
"proxy2.xmpp-server", initiatorJID);
streamHostInfo1.addStreamHost("proxy2.xmpp-server", proxyAddress, 7778);
// return stream host info if it is queried
protocol.addResponse(streamHostInfo1, Verification.correspondingSenderReceiver,
Verification.requestTypeGET);
// build a SOCKS5 stream host info containing the address and the port of the proxy
Bytestream streamHostInfo2 = Socks5PacketUtils.createBytestreamResponse(proxyJID,
initiatorJID);
streamHostInfo2.addStreamHost(proxyJID, proxyAddress, 7778);
// return stream host info if it is queried
protocol.addResponse(streamHostInfo2, Verification.correspondingSenderReceiver,
Verification.requestTypeGET);
// build used stream host response
Bytestream streamHostUsedPacket = Socks5PacketUtils.createBytestreamResponse(targetJID,
initiatorJID);
streamHostUsedPacket.setSessionID(sessionID);
streamHostUsedPacket.setUsedHost(proxyJID);
// return used stream host info as response to the bytestream initiation
protocol.addResponse(streamHostUsedPacket, streamHostUsedVerification,
Verification.correspondingSenderReceiver, Verification.requestTypeSET);