You don’t have to, but you may need to. Smack’s new
ModularXmppClientToServerConnection will per default have all available XMPP transports configured, and, if the right Smack artifact is in the classpath, then this will include the module for WebSockets. If your XMPP server then announces the availability of a WebSocket endpoint, over a supported discovery mechanism, then Smack will automatically try to use WebSockets if a plain TCP(+TLS) connection can’t be established.
Please let me know if you have further questions. I am aware that Smack’s documentation regarding the new connection mechanism is lacking, and understanding the questions and issues users face helps me to improve the documentation.