Results 1 to 10 of 10
  1. #1

    Testing client with https://push.lightstreamer.com/

    Hi All,

    I am using one of the sample projects (Lightstreamer-example-StockList-client-dotnet-master) to connect to a liststreamer server. I am not interested to install a Lightstreamer server on my computer and I hope to be able to connect to a demo server on lightstreamer website. For example, there is a wss stream https://push.lightstreamer.com/
    When I checked the websocket address, I found out the stream comes from wss://push.lightstreamer.com/lightstreamer.

    I tried to set the url to both addresses, but the application shows error 404 (not found). I used the port of 443 (I am assuming it is 443, because of https address).

    - Is it possible to identify the port used by wss to push data on a random website? Or is the client that can decide what port should be used?

    - Is there a url that I could use to test the StockList demo application (without having to install the server on my computer).

    Thanks,
    Nick

  2. #2
    I downloaded and installed the compiled sample application - I found out that the push address was http://push.lightstreamer.com:80.
    Now the demo application that I compiled also works. I also tried changing the port from 80 to 81 and the application did not work. So, it seems that the server application decides what port to use. Does the sample application work with a secure connection? Also, how can I find what port is being used on a random server?

    PS - After some more work, I found out the sample application also works with https://push.lightstreamer.com:443.
    Last edited by NickF; April 2nd, 2017 at 03:21 PM.

  3. #3
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi NickF,

    Yes, I confirm that almost all of our demo can be executed in secure mode, and our online server responds on standard ports for http and https protocols (80 and 443).
    A clarification regarding websocket that you've mentioned in a previous post, please be aware that at the moment the Lightstreamer .NET PCL Client Library does not support websocket, but works in HTTP streaming.

    At the moment websocket are supported by the client libraries: Web e Node.js (JavaScript), Java SE, Andorid, and with the Generic Client (implementing the TLCP protocol).

    Regards,
    Giuseppe

  4. #4
    Quote Originally Posted by giuseppe.corti View Post
    Hi NickF,

    At the moment websocket are supported by the client libraries: Web e Node.js (JavaScript), Java SE, Andorid, and with the Generic Client (implementing the TLCP protocol).

    Regards,
    Giuseppe
    Hi Giuseppe,

    Thanks for help. Can the sample "Lightstreamer - Hello World Tutorial - TCP Sockets Adapter" connect to a ws address?
    I compiled the project using C#, as described at https://github.com/Lightstreamer/Lig...adapter-socket

    The project uses "localhost" as a host. I replaced the host with "http://push.lightstreamer.com" and
    "ws://push.lightstreamer.com/lightstreamer", but the application reports it can't connect to the lightstream server.

    What am I doing wrong?

    Kind regards,
    Nick
    Last edited by NickF; April 7th, 2017 at 12:27 PM.

  5. #5
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi Nick,

    Please be aware that the project you are referring, concerns the implementation of the Adapters, and therefore only the server-side.
    In this case, you can not use our demo server, but you should use a local instance. In this case, communication between your adapter and the server have to use a plain TCP socket protocol (since we assume a local network).

    But, if you want a client-side example that directly uses websockets you should refer to this project: https://github.com/Lightstreamer/Lightstreamer-example-Quickstart-client-socket

    Regards,
    Giuseppe

  6. #6
    Thanks again Giuseppe,

    I am half way through testing curl connection. The page https://github.com/Lightstreamer/Lig...-client-socket is supposed to show the session id in bold characters, but there are no bold characters displayed.
    In the example provided, we get as response the line "CONOK,__Sa5268cc2d401967bT4311553__,50000,5000,*"

    Which is the session id from there? When we replace the session id, do we still keep the leading and trailing double underscores? I assumed the session id is either
    Sa5268cc2d401967bT4311553 or a5268cc2d401967bT4311553 and I tried this:

    C:\_Projects\curl-master>curl -v -N -X POST -d "LS_op=add&LS_subId=1&LS_data_adapter=CHAT_ROOM&LS _group=chat_room&LS_schema=timestamp%20message&LS_ mode=DISTINCT&LS_session=__Sb9e9708aa6807646T16356 34__&LS_reqID=1" http://push.lightstreamer.com/lights...col=TLCP-2.0.0
    Note: Unnecessary use of -X or --request, POST is already inferred.
    * Trying 54.203.248.234...
    * TCP_NODELAY set
    * Connected to push.lightstreamer.com (54.203.248.234) port 80 (#0)
    > POST /lightstreamer/control.txt?LS_protocol=TLCP-2.0.0 HTTP/1.1
    > Host: push.lightstreamer.com
    > User-Agent: curl/7.53.1
    > Accept: */*
    > Content-Length: 164
    > Content-Type: application/x-www-form-urlencoded
    >
    * upload completely sent off: 164 out of 164 bytes
    < HTTP/1.1 200 OK
    < Server: Lightstreamer-Server/6.1.1 build 1821 (Lightstreamer Server - www.lightstreamer.com) Vivace edition
    < Content-Type: text/enriched; charset=ISO-8859-1
    < Cache-Control: no-store
    < Cache-Control: no-transform
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Expires: Thu, 1 Jan 1970 00:00:00 GMT
    < Date: Sat, 8 Apr 2017 15:19:55 GMT
    < Content-Length: 37
    < x-accel-buffering: no
    <
    ERROR,65,LS_reqId parameter missing
    * Connection #0 to host push.lightstreamer.com left intact


    PS - I found there was a typo on github page - the example should have contained "LS_ReqId", not "LS_ReqID"

    Now, this is what I get:
    C:\_Projects\curl-master>curl -v -N -X POST -d "LS_op=add&LS_subId=1&LS_data_adapter=CHAT_ROOM&LS _group=chat_room&LS_schema=timestamp%20message&LS_ mode=DISTINCT&LS_session=Sfb25f9e55ac83dedT0253539 &LS_reqId=1" http://push.lightstreamer.com/lights...col=TLCP-2.0.0
    Note: Unnecessary use of -X or --request, POST is already inferred.
    * Trying 54.203.248.234...
    * TCP_NODELAY set
    * Connected to push.lightstreamer.com (54.203.248.234) port 80 (#0)
    > POST /lightstreamer/control.txt?LS_protocol=TLCP-2.0.0 HTTP/1.1
    > Host: push.lightstreamer.com
    > User-Agent: curl/7.53.1
    > Accept: */*
    > Content-Length: 160
    > Content-Type: application/x-www-form-urlencoded
    >
    * upload completely sent off: 160 out of 160 bytes
    < HTTP/1.1 200 OK
    < Server: Lightstreamer-Server/6.1.1 build 1821 (Lightstreamer Server - www.lightstreamer.com) Vivace edition
    < Content-Type: text/enriched; charset=ISO-8859-1
    < Cache-Control: no-store
    < Cache-Control: no-transform
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Expires: Thu, 1 Jan 1970 00:00:00 GMT
    < Date: Sat, 8 Apr 2017 15:44:59 GMT
    < Content-Length: 31
    < x-accel-buffering: no
    <
    REQERR,1,20,Session not found
    * Connection #0 to host push.lightstreamer.com left intact

    The session is reported not found - I imagine the first command (that has a response ending with PROBE, PROBE... is establishing the connection and generates a session id. But in order to send the second command, I have to stop the first one with Ctrl + C and the session will be ended? Otherwise, how can I send the second command?

    Thanks,
    Nick

    Last edited by NickF; April 8th, 2017 at 06:03 PM.

  7. #7
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    Nick, sorry for the errors in the post, now fixed.
    The underscores before and after the session ID were an attempt to trigger the bold characters, but this didn't work in the code block.

    Your final "control.txt" request seems correct.
    I see a space after the session ID, but I checked in our logs and there is no space, so you issued the request correctly.
    I confirm that the only issue here is that you had interrupted the response to the "create_session.txt" request several minutes before.
    Instead, the connection has to be kept active and the "control.txt" request has to be issued on a parallel socket.

    Having two sockets available is a requirement with Lightstreamer.
    You can avoid this requirement (for most usage cases) if you use a WebSocket.
    This is not shown in our quickstart example, but full instructions on the communication protocol can be found here.

  8. #8
    Dear Dario,

    Thank you very much for explanations. I opened two console windows and run curl in each and I can run now both commands without getting any errors. I could not think of running two sessions in separate consoles
    The space at the end of the LS_Session (mode=DISTINCT&LS_session=Sfb25f9e55ac83dedT0253539 &LS_reqId=1) seems to be introduced by the software running the forum (if I go to edit my post, there is no space in edit mode).

    I will follow the document you referred to, maybe I'll be able to make a program to read the information from a web page such as
    http://demos.lightstreamer.com/Angular2Demo/. Is there a demo application available with source code, that already does that (I prefer C#)? Or at least, is there a way to use curl commands that show how to download the stream from there?

    Kind regards,
    Nick



  9. #9
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    Hi Nick, If I understand correctly, you would like to setup a demo program in C# that shows the same data that you can see in the Angular2 demo.

    This is possible, because these fake trading data are also generated by our online Server, along with the chat data used by the Quickstart example.
    We provide a demo in C# which does that, with source code included; but note that it takes advantage of our .NET SDK library, which takes care of managing the protocol.

    If you prefer an example which gets the fake trading data directly operating at protocol level, this one is available, but it is in Python.

  10. #10
    Hi Dario,

    Thank you very much for the links. I run the Python code successfully. I will try the C# demo later.

    Nick

 

 

Similar Threads

  1. Integration testing
    By kjohann in forum General
    Replies: 8
    Last Post: May 5th, 2013, 01:24 PM
  2. Lighstreamer stress testing
    By Andrea in forum Adapter SDKs
    Replies: 3
    Last Post: April 30th, 2012, 05:39 PM
  3. Replies: 1
    Last Post: July 12th, 2010, 11:05 AM
  4. Replies: 1
    Last Post: February 23rd, 2009, 12:41 PM
  5. HTTPS & Flex Client
    By venkihere in forum Client SDKs
    Replies: 13
    Last Post: October 22nd, 2007, 06:01 PM

Tags for this Thread

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 09:40 AM.