NodeJS cannot start WebScocket stream

Hello there team,
I'm trying to connect to the websocket using the NodeJS library but I'm getting the following error.
i'm not sure what I am doing wrong
  • sujith
    Can you paste complete code here?
    Please don't paste app or user-related tokens on public threads. If you have to share these details then you can private message us.
  • akshayhalasangi
    akshayhalasangi edited February 2020
    var ticker = new KiteTicker({
    api_key: "Key",
    access_token: "token"

    console.log("this is called");
    // set autoreconnect with 10 maximum reconnections and 5 second interval
    ticker.autoReconnect(true, 10, 5)
    ticker.on("ticks", onTicks);
    ticker.on("connect", subscribe);
    ticker.on("error", onError);
    ticker.on("noreconnect", function() {

    ticker.on("reconnecting", function(reconnect_interval, reconnections) {
    console.log("Reconnecting: attempt - ", reconnections, " innterval - ", reconnect_interval);

    function onTicks(ticks) {
    console.log("Ticks", ticks);
    function onError(err)

    function subscribe() {
    var items = [738561];
    ticker.setMode(ticker.modeFull, items);
  • sujith
    This code seems fine. Can you paste the complete stacktrace here?
    Have you implemented onError? Can you log the error?
  • sujith
    Where are you calling this? Can you let us know more about the setup and library version, node version?
Sign In or Register to comment.