Skip to main content
Participant
August 9, 2007
Question

Can't connect to server remotely, connects fine locally

  • August 9, 2007
  • 2 replies
  • 492 views
I've got an extremely frustrating problem that I can't figure out. I have a simple application to test the connection to the FMS 2 server. If it can connect it basically just says "Connection Successful", if it can't connect "Connection Failed". It's named 'FMStest' and I have created a folder by that name in the 'applications' directory within the FMS2 directory. The local version connects successfully and shows as connected in the management console--the connection string I'm using locally is:

rtmpNow = "rtmp:/FMStest";

The remote connection fails everytime--I upload the published files to our webserver and access the created html file. the connection string I use for the remote connection is:

rtmpNow = "rtmp://my.domain.com/FMStest"; //domain changed for security reasons

Here is the full code:

var nc:NetConnection = new NetConnection();
var rtmpNow:String = new String();
rtmpNow = "rtmp://my.domain.com/FMStest"; //changed for privacy

nc.onStatus = function(info){

trace ("Level: "+info.level+" Code: "+info.code);
trace(code.list);
connect_txt.text = info.code;
if(connect_txt.text == "NetConnection.Connect.Failed"){
stat_text.text="Status: Not Connected";
status_text.text = "Connection to "+rtmpNow+" failed"+" Level: "+info.level+" Code: "+info.code;
}
else{
status_text.text = "connection successful";
stat_text.text="Status: Connected!";
}
};

nc.connect(rtmpNow);
stat_text.text = "Status: Connecting";

////////////////////////////////////////////////////////////
We've checked all the firewall and other configurations, I've tried all variations of the connection string (including using the IP address) No luck. Any ideas?

    This topic has been closed for replies.

    2 replies

    Participant
    August 14, 2007
    Is the domain that the flash client is loaded from the same as the one for FMS?

    From your client machine, can you telnet to the FMS server port 1935?
    s_brettAuthor
    Participant
    August 14, 2007
    Both the webserver and client are on the same domain as the FMS. I can't telnet to it, but I can connect to it through the FMS Management Console. This is on a university network, but the network admin has doublechecked the firewall configuration several times. Is there anything in the FMS configuration files that might be the culprit?
    August 14, 2007
    If you get a "Connection failed" from typing "telnet my.domain.com 1935", you have a connection problem. Try running the client from different sites (starting from the server itself) to identify the component that's blocking the connection.

    You can try running the server on more ports than 1935. Try port 1935 and port 80 with RTMP and RTMPT.
    To do so shutdown your server and edit the ADAPTOR.HOSTPORT entry in fms.ini. You may have to disable your webserver to avoid port conflicts. Then start FMS again and retry. Then check the log files. Best is to have a tail on access.00.log
    Participant
    August 9, 2007
    crossdomain? I haven't gotten far enough in my development to try connecting to a remote server so I don't really know, but I know connecting to other services requires a crossdomain file.
    s_brettAuthor
    Participant
    August 9, 2007
    I'm afraid I'm not familiar with that type of file--I haven't run across anything like that. Do most people run their webserver on the same machine as their FMS? Although the FMS server is separate from the webserver, they are all on the same domain (and for now I am connecting to both on the same domain as well). Maybe I'm understanding it all wrong.