I’m using the smack library to handle an XMPP/Jabber connection. I know that smack has support for XEP-0065, but I don’t see an option to specify a preferred bytestream proxy host. For servers like Jabber.org, this is necessary, as the one provided in service discovery (proxy.eu.jabber.org) doesn’t work. Additionally, some servers don’t list a proxy for service discovery. How does one specify the preferred SOCKS5 bytestream proxy to smack?
(Clarification: This isn’t about having smack connect to a proxy server to start its XMPP session; this is purely for use in scenarios where NATs prevent XMPP file transfers.)
I did some source diving and finally found where the code selects the proxy. This isn’t possible in r13041 of Socks5BytestreamManager.java: in
establishSession(String targetJID, String sessionID), it enumerates the proxies from the XMPP server and immediately proceeds to gather the hostname and port of the proxies. There is no provision to add a custom proxy host to the list.