Home > Products > 123 Flash Chat > How to configure connection?
Tutorials

How to configure connection in 123 Flash Chat Server Software

How to configure connection?

Only proper configuration on both of the chat server and chat client can make connection established between them.

1. server configuration

To configure connection in <123FlashChatServer installed DIR>\server\etc\fcserver.xml, edit "connection" section.

<Connection>
<primary-server ip="*" port="51127" />
<secondary-server ip="*" port="51128" enable="off" />

<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
</Connection>

You can set double servers and listen to double ports.

primary-server


secondary-server



Why there's a second server port option? The reasons are:

1) flash player earlier than 7 only allow access on high port (1024-65535) out of security reason, while low port is forbidden. If you are okay with high port, you don't have to set secondary-server. Only if you want to set port lower than 1024, you need a secondary-server.
(See table1 below)

2) If setting the port of primary-server to lower than 1024, like 80, then only users with flash player 7 can access chat while users with flash player 6 can't.
In this case secondary-server is necessary. Its port should be greater than 1024, which allow users with earlier flash player to chat.
(See table1 below)

3) If setting high port for primary-server, then usually you don't need secondary-server, you can leave it as default :enable="off" .
(See table2 below)

4) It's just temporary solution to set two servers because some of users are still using flash player earlier than 7.
When flash player 7 becomes more and more popular, we'll remove this secondary-ser3ver function in future version.

To help understanding, please study two tables below:

 High port (1024-51127)Low port (<1024)
>=Flash player 7
Primary server
< Flash player 7
secondary server

table1

 
 High port (1024-51127)Low port (<1024)
>=Flash player 7
Primary server
< Flash player 7
(unnecessary)

table2

 

Recommended Simple Setting:

Leave the connection configuration as default.


Advanced Setting:

To bind your chat server to low port like 80 or 443, here's the solution:
(See above table1.)

For primary-server, set a port lower than 1024, like "80" or "443".
While for secondary-server, set a port higher than 1024.

With such a connection setting, secondary-server is only useful to users with earlier version of flash player. (As we stated before, flash player earlier than 7 only allow access on high port (1024-65535).)

IP configuration:

Case 1:

When your web server and chat server are on the very same server machine, it is highly recommended you leave the server host as default "*", which means the chat server will bound all IP of your server. Then the host value in client.xml can be "*" too, which we'll explain later in client configuration section, or a random IP of yours , or any domain name which points to any IP address of your server. Client can connect to server in either way.

Or, if you set server ip to any specific IP of your server, then chat server will only bound one IP. Well then in client.xml, you have to use this specific IP or the domain name points to this IP to connect chat server.

Case 2:

When your web server and chat server are NOT on the same server, it's a bit more complicated. The server host can be set to "*" or any specific IP address, and the host value in client configuration has to be identical. If server host="*", then client host can be any random IP or domain name which points to the IP; If server host= a specific IP, the client host can only be the IP, too, or a domain name which points to the IP.

cross-domain-policy:

123 flash chat server start uses cross-domain-policy to enhance security.
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>

By default it permits access to documents originating from any domain.

To limit access only from one domain name, you can configure like this:
<cross-domain-policy>
<allow-access-from domain="www.mydomain.com" />
</cross-domain-policy>

Or you can allow all URL on mydomain.com to access:

<cross-domain-policy>
<allow-access-from domain="*.mydomain.com" />
</cross-domain-policy>

To allow multiple domain name to access:

<cross-domain-policy>
<allow-access-from domain="www.myfriendsdomain.com" />
<allow-access-from domain="*.mydomain.com" />
<allow-access-from domain="11.22.33.44" />
</cross-domain-policy>

2. client configuration

To configure connection in client.xml, please edit "connection" tag.
The changes of "connection" tag in client.xml must be coordinate with the "connection" tag in fcserver.xml.

<Connection>
<primaryServer host="127.0.0.1" port="51127" />
<secondaryServer host="127.0.0.1" port="51128" enable="false" />
</Connection>

If you want to launch chat-room on internet, please replace the "127.0.0.1" with your specific IP!

About host value, it can be chat server IP address, or server hostname.

When your web server and chat server are on the very same server machine, it is highly recommended you leave the client host as default "*", which means the default web server IP address. For example, if the URL of the client.xml is: http://abcd.com/xyz/abc/client.xml, then the "*" in client host value is equal to "abcd.com".

If you want to change client host, keep it match the server host value anyway.

One more issue is about flash player. The flash player earlier than version 7 only allow connection with the same domain name for security reason.

In flash player 6, For example:
the domain "www.123flashchat.com" resolves to 69.93.110.158,
the client SWF file located at http://www.123flashchat.com/123flashchat.swf cannot connect to the server if you set host value to: 69.93.110.158, you should set host value to www.123flashchat.com instead.

A SWF file located at http://69.93.110.158/123flashchat.swf cannot connect to the server if you set host value to: www.123flashchat.com, you should set host value to 69.93.110.158.

Identical numeric IP addresses are compatible. However, a domain name is not compatible with an IP address, even if the domain name resolves to the same IP address.

The following table shows examples of compatible domains:

www.123flashchat.comwww.123flashchat.com
abc.123flashchat.comabc.123flashchat.com
69.93.110.15869.93.110.158
   
The following table shows examples of incompatible domains:
www.123flashchat.comabc.123flashchat.com
123flashchat.comwww.123flashchat.com
www.123flashchat.com123flashchat.com
69.93.110.158www.123flashchat.com (even if this domain resolves to 69.93.110.158)
www.123flashchat.com69.93.110.158 (even if www.123flashchat.com resolves to this IP)
  

Further contact

If you haven't fully understood this tutorial and if "connection failed" happened to you, please contact our supporter :
http://www.123flashchat.com/support.html
We support in following ways:
1) Online support (online demo, or on MSN, etc)
2) Email support
3) Phone support
Our support team will try to resolve your problem ASAP.
TOPCMM News
24 Hours Support
+86-21-51785636 (China)
+1-858-866-9362 (USA)
Mailing List

For news, update and promotion of TOPCMM.


Home | About | Products | Download | FAQ | Order | Support | Features | Reviews | Demo | Links | Sitemap | Forum | Blog

Flash Chat | Java Chat Server| Chat Server Software| Instant Messaging Software| Live Help Chat
Webcam Chat | Web Chat Room| Enterprise Messaging| Enterprise Chat Software| Flash Chat in China
Legal Disclaimer| Privacy Statement | Terms of Use    Copyright © 2001-2008 TopCMM Software Corp. All Rights Reserved.