Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Feb 2009
    Location
    KL
    Posts
    29

    Can't connect to lightstreamer in firefox

    Hi,

    I have a push page which able to open with IE and also able to receive push data from Lightstreamer server. But when I try open it in firefox, there was no data showing and the engine seems cannot connect and keep attempt to connect to the Lightstreamer server. Following are my code on the engine configuration:
    Code:
            var lsPage = new PushPage();
    	var debugAlerts = true;
    	var remoteAlerts = true;
    	var pushHost = null;
    	var pushPort = 8080;
    
    	debugAlerts = true;
    	remoteAlerts = true;
    	pushHost = document.domain;	
    	
    	lsPage.context.setDebugAlertsOnClientError(debugAlerts);
    	lsPage.context.setRemoteAlertsOnClientError(remoteAlerts);
    	
    	lsPage.onEngineCreation = function(lsEngine) {
    		lsEngine.context.setDebugAlertsOnClientError(debugAlerts);
    		lsEngine.context.setRemoteAlertsOnClientError(remoteAlerts);
    
    		lsEngine.connection.setLSHost(pushHost);
    		lsEngine.connection.setLSPort(pushPort);
    		lsEngine.connection.setAdapterName("RBMS");
    		
    		lsEngine.policy.setMaxBandwidth(200);
    		lsEngine.policy.setIdleTimeout(30000);
    		lsEngine.policy.setPollingInterval(10000);
    
    		//lsEngine.onStatusChange = ChangeWindowStatus;
    		lsEngine.changeStatus("STREAMING");
    	}
    	
    	lsPage.bind();
    	lsPage.createEngine("HelloWorldApp","LS","SHARE_SESSION");
    	
    	/////////////////////////////////table handler	
    	var commandTable = new NonVisualTable("NewUser", schemaCommand, "COMMAND"); 
    	//TABLE
    	commandTable.setSnapshotRequired(true);
    	commandTable.setRequestedMaxFrequency(0.5);
    	//NonVisualtable
    	commandTable.onItemUpdate = myUpdateHandler;
    	lsPage.addTable(commandTable, "news");
    and from the server, I am keep watching the following command on each time firefox connecting to the server:
    Code:
    20.Aug.09 10:53:09,549 < INFO> Serving request: /lightstreamer/create_session.ht
    ml?LS_phase=6301&LS_requested_max_bandwidth=200&LS_polling=true&LS_polling_milli
    s=10000&LS_idle_millis=30000&LS_client_version=4.3&LS_adapter=RBMS& from 192.168
    .1.21:1256
    20.Aug.09 10:53:09,549 < WARN> Bandwidth control request ignored
    20.Aug.09 10:53:09,549 < INFO> Starting new session: Sa889b5620686f3a6T5309549 f
    rom 192.168.1.21:1256
    20.Aug.09 10:53:09,549 <TRACE> RELEASING DATA --> HTTP/1.0 200 OK
    Date: Thu, 20 Aug 2009 02:53:09 GMT
    Server: Lightstreamer/3.5 build 1428.4 (Lightstreamer Push Server - www.lightstr
    eamer.com) Moderato edition
    Content-Type: text/html; charset=iso-8859-1
    Cache-Control: no-store
    Cache-Control: no-cache
    Pragma: no-cache
    Expires: Thu, 1 Jan 1970 00:00:00 GMT
    Content-Length: 927
    Connection: Keep-Alive
    
    <!--
      -- LIGHTSTREAMER
      --    Live Web Content Delivery
      --
      -- www.lightstreamer.com - info@lightstreamer.com
      --
      -- Copyright (c) 2004-2008 Weswit s.r.l. All Rights Reserved.
      -->
    
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Cache-Control" content="no-store">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="Thu, 1 Jan 1970 00:00:00 GMT">
    <title>Lightstreamer is pushing...</title>
    
    <script language="JavaScript" src="/lightstreamer/pushFrameSettings.js">
    </script>
    </head>
    
    <body onload="if (! clsd) { retry(); }">
    <script>setPhase(6301);</script><script>start('Sa889b5620686f3a6T5309549', null,
     30000, 50000, 'Lightstreamer HTTP Server');</script><script>s0(0.0,1.0,-1.0);</
    script><script>loop(10000);</script><script>
    end(); clsd = true;
    </script>
    
    </body>
    </html>
    Appreciated if someone can help. Thank you.

    Chuan

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    517
    There is a wrong configuration in pushHost. It cannot be the same as the document.domain.

    What is your deployment architecture, with or without a Web Server? If you have a Web Server, is it on the same host of Lightstreamer Server or a different host?

  3. #3
    Member
    Join Date
    Feb 2009
    Location
    KL
    Posts
    29
    Quote Originally Posted by Alessandro
    There is a wrong configuration in pushHost. It cannot be the same as the document.domain.

    What is your deployment architecture, with or without a Web Server? If you have a Web Server, is it on the same host of Lightstreamer Server or a different host?
    Yes, I have a web server in the deployment. The web server is on the same host with Lightstreamer server. There is no problem when I open the web client/push page, it was able to receive the push data from Lightstreamer server. Just that the same push page seems having some problems when connecting to Lightstreamer server on Firefox.

    And regarding the deployment architecture, I try to separated the Lightstreamer server and web server into 2 different host, and the Lightstreamer server is assigned a sub domain (push.abc.com) of the web server (www.abc.com). I set the pushHost = "push.abc.com" (on the push page) and open it and I get permission denied. Therefore I put both the Lightstreamer and Web Server on the same host and set the pushHost = document.domain. It works on IE but not Firefox.

    Chuan

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    If the Web Server is on www.abc.com and Lightstreamer Server is on push.abc.com,
    you can make them communicate if you set the domain as abc.com.
    Note that you must set the domain through the library-provided setDomain method
    (follow the note in point 6 of GETTING_STARTED.TXT);
    I can't find the call in your code snippet.

    If you use the same host for both servers, with different ports,
    there is no domain setting that works on both IE and FF;
    if you don't set the domain at all (or call setDomain(null) ), this works only in IE.
    According to the above, in the setDomain docs, we claim that we don't support the case for production scenario.

  5. #5
    Member
    Join Date
    Feb 2009
    Location
    KL
    Posts
    29
    Quote Originally Posted by DarioCrivelli
    If the Web Server is on www.abc.com and Lightstreamer Server is on push.abc.com,
    you can make them communicate if you set the domain as abc.com.
    Note that you must set the domain through the library-provided setDomain method
    (follow the note in point 6 of GETTING_STARTED.TXT);
    I can't find the call in your code snippet.

    If you use the same host for both servers, with different ports,
    there is no domain setting that works on both IE and FF;
    if you don't set the domain at all (or call setDomain(null) ), this works only in IE.
    According to the above, in the setDomain docs, we claim that we don't support the case for production scenario.
    Thanks Dario, I am now trying to set up the lightstreamer server on another host which is different with the web server. But due to some network problem I can't access it at the moment. I update here later on any updates.

    Just that there is an issue which our team is more concerning is the firefox issue. We are wondering why the same push page able to run on the IE but not in firefox. I have posted on the first post in this thread.

    Thanks

  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    517
    Security restrictions concerning cross-frame and cross-domain communication may be slightly different across different browsers. But if you follow the instructions provided in our documentation carefully, we guarantee a consistent behavior across all browsers.

  7. #7
    Member
    Join Date
    Feb 2009
    Location
    KL
    Posts
    29
    Hi Dario,

    I have deploy the Lightstreamer server to another host which is different with the web server. The Lighstreamer server using the domain gts.vcb.com; while the web server using www.vcb.com. I set the domain using setDomain method and set the pushHost as follow:
    Code:
            var lsPage = new PushPage();
    	var debugAlerts = true;
    	var remoteAlerts = false;
    	var pushHost = null;
    	var pushPort = 3633;
    
    	debugAlerts = false;
    	remoteAlerts = true;
    	pushHost = "gts.vcb.com";	
    
    	lsPage.context.setDomain("vcb.com");
    	lsPage.context.setDebugAlertsOnClientError(debugAlerts);
    	lsPage.context.setRemoteAlertsOnClientError(remoteAlerts);
    	
    	lsPage.onEngineCreation = function(lsEngine) {
    		lsEngine.context.setDebugAlertsOnClientError(debugAlerts);
    		lsEngine.context.setRemoteAlertsOnClientError(remoteAlerts);
    
    		lsEngine.connection.setLSHost(pushHost);
    		lsEngine.connection.setLSPort(pushPort);
    		lsEngine.connection.setAdapterName("RBMS");
    		
    		lsEngine.policy.setMaxBandwidth(200);
    		lsEngine.policy.setIdleTimeout(30000);
    		lsEngine.policy.setPollingInterval(10000);
    
    		//lsEngine.onStatusChange = ChangeWindowStatus;
    		lsEngine.changeStatus("STREAMING");
    	}
    		
    	lsPage.bind();
    	lsPage.createEngine("HelloWorldApp","LS","SHARE_SESSION");
    But the push page still having the connection problem. The browser's status bar shows "Lightstreamer is disconnected" and the server see no response. I am still wondering how to connect it with two different host. Please correct me if I'm wrong. Thank you.

  8. #8
    Member
    Join Date
    Feb 2009
    Location
    KL
    Posts
    29
    I have added the lsPage.context.setDomain() on the engine configuration, and the push page is able to open with firefox now but I am not sure whether I miss something or what, the lsPage.context.setDomain() seems doesn't work on IE browser and prompt me the following message while connecting:

    1: 17:43:21,255 ER bind Unable to find the Engine. Retrying. If the problem persists, please check your configuration.

    Therefore I have added the browser detection in the script and call the seDomain method accordingly. Both IE and firefox are working now.

  9. #9
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    which hostname do you use on the browser address bar to reach your page?
    please read setDomain documentation and check the Known Browser Issue section of the forum.
    Following our guidelines you should be able to run your application without any browser detection code.

  10. #10
    Member
    Join Date
    Feb 2009
    Location
    KL
    Posts
    29
    Hi Mone,

    Maybe I have miss something because the previous issue only happened on the same host architecture on our testing server. When I deploy it on the separate host architecture (different host of Lightstreamer server and web server), it works on both IE and Firefox browser.

    Quote Originally Posted by Alessandro
    Security restrictions concerning cross-frame and cross-domain communication may be slightly different across different browsers. But if you follow the instructions provided in our documentation carefully, we guarantee a consistent behavior across all browsers.
    the separate two server to two different host issue is solve, it happen because of the setDomain command missing, I left out this command line previously . Currently the issues are done but I will go through lot more testing again anyway.

    Thanks a lot for all the information.

 

 

Similar Threads

  1. Replies: 3
    Last Post: November 14th, 2011, 10:33 AM
  2. Connect to LightStreamer with NodeJS
    By afshinmeh in forum Client APIs
    Replies: 1
    Last Post: October 6th, 2011, 07:31 PM
  3. Replies: 2
    Last Post: August 22nd, 2011, 09:25 AM
  4. RTD Demo will not connect to Lightstreamer Server
    By krohnjw in forum Client APIs
    Replies: 23
    Last Post: February 8th, 2011, 02:47 PM
  5. Cannot connect to 6661,2,3 ports
    By ap7256 in forum Adapter APIs
    Replies: 3
    Last Post: October 23rd, 2007, 11:02 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 11:02 PM.