The answer is rather obvious.
Strophe requires the username in the following format:
username@host
eg. admin@example.com
It otherwise assumes that the username is really the host, and since such a host doesn't exist, it throws an error that mod_http_bind is not started in that host
This error is misleading at best, but it does technically explain the issue.
I was trying to login with just the username [which worked fine in JWChat], hence the issue.
In case this doesn't work, a checklist of some of the other things to verify:
Make sure that your domain is added to /etc/hosts
127.0.0.1 localhost.localdomain localhost 12.34.56.78 squire.example.com squire
Make sure that your domain is added to /etc/ejabberd/ejabberd.cfg
%% Hostname Hostname {hosts, ["example.com","98.765.43.21","localhost"]}.
Ensure that your username exists and is registered:
ejabberdctl register username example.com password
And if user is an admin, is included in ejabberd.cfg [Note: it must also be registered!]
%% Admin user {acl, admin, {user, "", "localhost"}}. {acl, admin, {user, "admin", "example.com"}}.
Check that the server is running:
a. sudo ejabberdctl status b. http://example.com:5280/admin c. http://example.com:5280/http-bind
If there are issues, restart using both (I know you don't need both in theory. In practice, sometimes using one or the other would not work right.)
sudo /etc/init.d/ejabberd restart sudo ejabberdctl restart
Check the logs - /var/log/ejabberd/ejabberd.log (see here).
Install JWChat and try that (or, if you have JWChat, install Strophe).
The following short tutorial is invaluable, follow it exactly: http://www.ejabberd.im/jwchat-localserver