Class Socks5Utils
- java.lang.Object
-
- org.jivesoftware.smackx.bytestreams.socks5.Socks5Utils
-
public class Socks5Utils extends Object
A collection of utility methods for SOcKS5 messages.
-
-
Constructor Summary
Constructors Constructor Description Socks5Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
createDigest(String sessionID, Jid initiatorJID, Jid targetJID)
Returns a SHA-1 digest of the given parameters as specified in XEP-0065.static byte[]
receiveSocks5Message(DataInputStream in)
Reads a SOCKS5 message from the given InputStream.
-
-
-
Constructor Detail
-
Socks5Utils
public Socks5Utils()
-
-
Method Detail
-
createDigest
public static String createDigest(String sessionID, Jid initiatorJID, Jid targetJID)
Returns a SHA-1 digest of the given parameters as specified in XEP-0065.- Parameters:
sessionID
- for the SOCKS5 BytestreaminitiatorJID
- JID of the initiator of a SOCKS5 BytestreamtargetJID
- JID of the target of a SOCKS5 Bytestream- Returns:
- SHA-1 digest of the given parameters
-
receiveSocks5Message
public static byte[] receiveSocks5Message(DataInputStream in) throws IOException, SmackException.SmackMessageException
Reads a SOCKS5 message from the given InputStream. The message can either be a SOCKS5 request message or a SOCKS5 response message.(see RFC1928)
- Parameters:
in
- the DataInputStream to read the message from- Returns:
- the SOCKS5 message
- Throws:
IOException
- if a network error occurredSmackException.SmackMessageException
- if the SOCKS5 message contains an unsupported address type
-
-