Skip to content

danyim/ng-jabberd

Repository files navigation

ng-jabberd

Simple XMPP chat client built in Angular 1

Installation

Server

  • Follow this guide from ejabberd to build the source with OSX and to get ejabberd up and running. I recommend installing Adium (brew cask install adium) to verify that your server works

  • Verify that http_bind is enabled by navigating to http://localhost:5280/http-bind.

  • Copy the included configuation file to the default installation directory ~/my-ejabberd

    • cp /config/ejabberd.yml ~/my-ejabberd/etc/
  • Restart the server

    • ~/my-ejabberd/sbin/ejabberdctl restart
  • Verify that the server is running

    • ~/my-ejabberd/sbin/ejabberdctl status

        $ ~/my-ejabberd/sbin/ejabberdctl status    
        The node ejabberd@localhost is started with status: started
        ejabberd 17.03.3 is running in that node
      
  • Create a couple users

    • ~/my-ejabberd/sbin/ejabberdctl register bob localhost bob
    • ~/my-ejabberd/sbin/ejabberdctl register alice localhost alice
  • Open Adium (or another XMPP client) and log in as alice@localhost : alice on localhost

Front-End

  • Run yarn to install dependencies
  • yarn start to start the dev server at http://localhost:8080/
  • Login with the users created from above:
    • Hostname: http://localhost:5280/http-bind
    • Username: bob@localhost
    • Password: bob
  • Click the + and add alice@localhost as a new recipient
  • Verify you can send and receive messages from alice@localhost

Limitations

  • (Major) Registration of new users will have to be done manually on the server due to the Strophe JS register plugin not sending the correct stanzas
    • Create a user on the server: ~/my-ejabberd/sbin/ejabberdctl register <user> localhost <password>
    • Login as <user>@localhost for the username on the frontend
  • (Minor) Unable to get a chatstatus or a presence stanza from the ejabberd server, therefore no typing notification or (true) online status. The online status shown in the app assumes they're online if the other party is sending a message.
  • (Minor) Reattaching sessions after a browser refresh is still a work in progress. Partial implementation can be found in /src/strophe.service.js via the reattach() function
  • (Minor) StropheJS doesn't play well with Webpack and AMD (another source), so this project defines them manually in <script> tags inside /public/index.html and uses Webpack's externals option to expose the global

Resources

License

MIT