Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

81
Visualizações
Lightstreamer set connection options in JS

Hello i try to understand this lib and i have a python source here https://github.com/ig-python/ig-markets-api-python-library/blob/master/trading_ig/lightstreamer.py on line 187 I'm able to add LS_op2 or set LS_container but I have problems on doing this on the js version.

the first message i want is:

LS_op2=create&LS_phase=5701&LS_cause=new.api&LS_polling=true&LS_polling_millis=0&LS_idle_millis=0&LS_cid=pcYgxn8m8 feOojy*****f3g2.pz479mDv&LS_adapter_set=DEMO&LS_container=lsc&

but i get only

LS_phase=3201&LS_cause=new.nullresp&LS_polling=true&LS_polling_millis=0&LS_idle_millis=0&LS_cid=pcYgxn*** feOojyA1U661i3g2.pz47Af6k&LS_adapter_set=DEMO&

Maybe someone have a idea, here is my source, thanks.

  <html>
<head>
    <script src="https://unpkg.com/lightstreamer-client-web@8.0.3/lightstreamer.min.js"></script>
    <script>
        document.addEventListener("DOMContentLoaded", function(event) {
            var client = new LightstreamerClient("https://push.lightstreamer.com","DEMO");

            client.connect();
            var sub = new Subscription("MERGE",["item1","item2","item3"],["stock_name","last_price"]);
            sub.setDataAdapter("QUOTE_ADAPTER");
            sub.setRequestedSnapshot("yes");

            sub.addListener({
                onItemUpdate: function(obj) {
                   console.log(obj.getValue("stock_name") + ": " + obj.getValue("last_price"));
                }
            });
            client.subscribe(sub);
        });

    </script>
</head>
<body>
</body>
</html>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If the question is why Lightstreamer javascript SDK 8.0.3 library creates a different request, it is because the python code provided as reference (which doesn't lean on any SDK library) uses an earlier version of the communication protocol. Anyway, the request issued by the javascript library is supposed to work.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda