Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Nov 2010
    Location
    Bad Feilnbach
    Posts
    5

    How to port from LS server to a webserver

    Hello,

    I've build the first Hello World example () succesfully. When I try it on "http://localhost:8080/HelloWorld/" it runs without any problems.

    Now I would port these simple example on my local webserver to run it f.e. under "http://www.mytest.de/HelloWorld/".

    This are the steps I've done:

    1. host file
    is set to:
    127.0.0.1 www.mytest.de
    127.0.0.1 push.mytest.de

    2. locale web server
    I've created a folder 'HelloWorld' under the 'htdocs' folder in my locale web server.
    In this 'HelloWorld' folder I've created a 'LS' folder with all the required js files from the Lightstreamer installation and this index.html file:

    HTML Code:
    <html>
    <head>
    	<title>Hello World with Lightstreamer</title>
    	<script language="JavaScript" src="LS/lscommons.js"></script>
    	<script language="JavaScript" src="LS/lspushpage.js"></script>
    </head>
    <body>
    
    <div source="lightstreamer" table="hellotable" item="greetings" field="message">loading...</div>
    <div source="lightstreamer" table="hellotable" item="greetings" field="timestamp">loading...</div>
    
    <script>
    	var page = new PushPage();
    	page.context.setDomain("www.mytest.de");
    	page.onEngineCreation = function(lsEngine) {
    		lsEngine.context.setDebugAlertsOnClientError(true); 
          		lsEngine.connection.setLSHost("push.mytest.de"); 
          		lsEngine.connection.setLSPort(8080); 
          		lsEngine.connection.setAdapterName("HELLOWORLD");
          		lsEngine.changeStatus("STREAMING"); 
    	}
    	page.bind();
    	page.createEngine("HelloWorldApp", "LS", "SHARE_SESSION");
    
    	var pushtable = new OverwriteTable(null, null, "MERGE");
    	page.addTable(pushtable, "hellotable");
    </script>
    
    </body>
    </html>
    3. Under "Lightstreamer\adapters\" I've a folder "HelloWorld" whit the "adapters.xml" file and the "classes" folder with the JAVA class files.

    4. When I start the LS server (in command line) it starts without problems. After the start the example under "http://localhost:8080/HelloWorld/" runs correctly.

    When I try to load the URL "http://www.mytest.de/HelloWorld/" I get the following error message:



    What is wrong in my setup? As sayed above, under "http://localhost:8080/HelloWorld/" it is still running, under "http://www.mytest.de/HelloWorld/" I get the error.

    Thanks in advance for the help.

  2. #2
    Member
    Join Date
    Nov 2010
    Location
    Bad Feilnbach
    Posts
    5
    In the meantime I've played around and get it running in FireFox (6.3.12) and IE 7.

    I've changed the line
    page.context.setDomain("www.mytest.de");
    into
    page.context.setDomain("mytest.de");
    (removed the 'www')

    Now it works as estimated.

    Ciao.

 

 

Similar Threads

  1. hosting helloworld example on different webserver
    By rbg001 in forum Client SDKs
    Replies: 3
    Last Post: May 25th, 2011, 03:11 PM
  2. Replies: 4
    Last Post: January 11th, 2011, 11:21 AM
  3. Replies: 1
    Last Post: September 18th, 2009, 10:13 AM
  4. Replies: 1
    Last Post: February 22nd, 2008, 10:23 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:16 AM.