1. Search google for OpenAjax Hub tunnel, it's a standard practise for handling cross domain issues, and not specific to Sametime. Read up on it and why you need to do it.
2. Take a look at this document, and setting up the tunnel
https://www-10.lotus.com/ldd/stwiki.nsf/dx/Integrating_IBM_Sametime_in_a_Web_application_without_the_Dojo_Toolkit
3. Read the Sametime Proxy Toolkit SDK documentation.