Results 1 to 2 of 2
  1. #1

    What does setPhase() in the js client?


    I'm currently writing a python client for Lightstreamer 6.2.5 as part of a school project. My current goal is to get live prices of into a python project, so that other students are able to "speculate" with these assets.

    As Lightstreamer 6.2.5 is legacy and not supported anymore, I'm writing my own client. I've been diving a lot into the network requests, but after a lot of hours I still can't answer the following questions:

    1. Before connecting via WebSocket, the js Client makes a request to "".
    The request includes "LS_phase" as form data. What exactly is "LS_phase"? As far as I understood, it's just a random 4-digit number, which is later used when upgrading to the WebSocket.
    2. When sending the request to /create_session.js, the server answers with js which includes the same phase number and (I think) a session identifier, like "S74535bee154ceeb1T3449099". Wenn connecting to the WebSocket afterwards, this session identifier is sent to the server too. What's the difference between LS_phase and this session identifier?

    Please note that I can't switch to another language for this project, as it has to be implemented in python3.

  2. #2
    Join Date
    Feb 2012
    Hi Robert1,

    The old web libraries used an undocumented private protocol specific to the javascript languages.
    So it is not a good idea to try to reverse engineering that protocol in order to apply it to other languages.
    For example the LS_Phase is a very specific element of the javascript protocol used to recognize possible duplicate replies but which do not make sense in other languages.

    For your python client you should implement the TLCP protocol version 2.0.0:
    Something like this example do:
    Indeed there is a new ready made python client library but that requires a Lightstreamer server 7.x.

    Please also note you should make sure if the server you are targeting is enabled to accept requests for the TLCP protocol.




Similar Threads

  1. Does Java client use websocket?
    By carenot in forum General
    Replies: 1
    Last Post: June 16th, 2016, 10:30 AM
  2. How does lightstreamer do the filter?
    By gengliangyu2008 in forum Adapter SDKs
    Replies: 5
    Last Post: November 26th, 2010, 10:00 AM
  3. Replies: 1
    Last Post: July 28th, 2010, 11:15 AM
  4. Replies: 1
    Last Post: March 11th, 2010, 04:53 PM
  5. Replies: 1
    Last Post: August 27th, 2007, 12:24 PM


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:02 PM.