Rogerthat HTTP-XMPP developer gateway
We provide a tool for developers who
- Do not have an ip address which is public reachable from the internet. For example, developers working on their laptop at the office, who cannot receive incoming TCP connections originating from the internet.
- Are not very experienced in XMPP or do not want to use XMPP in production.
- Want to program in an HTTP model such as java servlets or .NET HTTP handlers.
The communication happens as follows:
- Service to Rogerthat calls are outgoing HTTPS calls. No difference with default behaviour
- For callbacks the situation is different:
- 1. HTTP-XMPP gateway makes an outgoing XMPP connection to its XMPP gateway.
- 2. Rogerthat sends callbacks over this XMPP connection to the gateway.
- 3. The gateway will translate the callbacks into HTTP(S) callbacks to the local application server
- This way, there are no incoming TCP connections. Moreover, the application server only servers HTTP(S) requests.
- When this setup is migrated into production, the service configuration must be modified and use HTTP instead of XMPP
Installation & usage
Create a jabber (XMPP) account
If you do not have one, create a jabber (XMPP) account:
- You can get one for free at https://webchat.chatme.im/register_web/chatme.im
- You can request one from us by sending a mail to firstname.lastname@example.org
- Note: you cannot use your gmail address since Google Talk is not fully compatible with XMPP
Installation on Microsoft Windows
- Download and install the router from http://www.rogerthat.net/wp-content/uploads/tools/RogerthatDevConnector/setup.exe
- Configure your jabber account & the location on which your development setup listens for callback requests:
- Switch to the running tab and press start.
You should see the xmpp stream in the black console window.
Installation on other operating systems
Virtual Box is a virtualization product which has support for all popular operating systems (windows, linux, mac osx, open solaris, …). We created a small linux image in which we deployed a twisted based xmpp to http Rogerthat router which should work in any environment that has a direct connection to the internet (behind a NAT is ok, not supported behind a proxy server).
More information about Virtual Box can be found on http://www.virtualbox.org.
Steps to install & use the router:
- If you don’t have Virtual Box installed, download & install it from here: https://www.virtualbox.org/wiki/Downloads
- Download the virtual router appliance from here: http://www.rogerthat.net/wp-content/uploads/tools/RogerthatDevRouter/Rogerthat_development_router.ova
- Import the virtual appliance into Virtual Box:
- Check the network configuration if the imported appliance is configured to use NAT:
- Boot the appliance and login with username ubuntu and password rogerthat
- Configure your keyboard via this command: sudo loadkeys us
Replace us in the above command with the country code matching your keyboard.
- Last thing is to launch the router by issuing the following command:
twistd -n rogerthat_service_call_forwarder -a "your jabber account" -p "jabber password" -u "uri to your development setup callback server"
Installation from source
- Clone the rogerthat-xmpp-service-forwarder repository.
Install the required python packages:
pip install -r rogerthat-xmpp-service-forwarder/src/requirements.txt
Run the xmpp forwarder using twisted:
twistd -n rogerthat_service_call_forwarder -a "your xmpp account" -p "your xmpp password" -u "uri to your development setup callback server"
Because an example says more than 1000 words… Example on my development environment:
twistd -n rogerthat_service_call_forwarder -a "email@example.com" -p "thisisnotmypassword" -u "http://localhost:8080/callback_api"