How to make push server with two machine(2-IP)

2 views
Skip to first unread message

park

unread,
Jan 28, 2010, 7:26:40 AM1/28/10
to StreamHub Comet Server Community
Hi..
We are digging StreamHub.
We want Two machines architecture. One is Tomcat HTML. The others is
Push server(StreamHub).
If HTML page of Tomcat call diffrent IP's StreamHub, how to configure?
We tested, but Fail !!!

Any idear?
thank you in advanced!

StreamHub Team

unread,
Jan 31, 2010, 9:02:09 AM1/31/10
to StreamHub Comet Server Community
Hi park,

You cannot use 2 different IPs because of the Same Origin Policy:

http://en.wikipedia.org/wiki/Same_origin_policy

In StreamHub, you can use sub-domains e.g.

www.myhost.com - Tomcat
push.myhost.com - StreamHub

or different ports e.g.:

www.myhost.com:80 - Tomcat
www.myhost.com:81 - StreamHub

If at the moment you are just developing/testing/evaluating you will
not need to buy any domains, just setup the hosts in the hosts file
for your Operating System.

On Windows this can be found at:

%SystemRoot%\system32\drivers\etc\hosts

On Linux/Unix:

/etc/hosts

For example, supposing Tomcat is on 10.0.0.1 and StreamHub 10.0.0.2,
setup the following in the hosts files on both systems:

10.0.0.1 www.myhost.com
10.0.0.2 push.myhost.com

Then always use the the full domain name (http://en.wikipedia.org/wiki/
Fully_qualified_domain_name) in the browser. e.g. http://www.myhost.com/
-- you do not have to own the myhost.com domain it just needs to be in
your hosts file.

This will work if you follow all the steps correctly.

If you still wish to address using the IP addresses in the browser
e.g. http://10.0.0.1/, firstly we would NOT recommend this. Secondly,
it will not work because of Same Origin Policy, so you will have to
setup a proxy or use 2 different ports on the same IP. For this we
can only point you in the direction of a Tomcat Valve or setting up
mod_proxy in Apache.


Hope this helps,

The StreamHub Team.

Reply all
Reply to author
Forward
0 new messages