For Matrix, what server software are you hosting and what's your subdomain setup? When logging in, you just enter the domain behind your username (e.g. use example.com if your username is @user:example.com)
Edit: not sure if Snikket supports multiple domains, but its upstream, the Prosody server, does that just fine