Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Websocket not working in Node JS

    Bugs
    4
    5
    49
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      goutamjaiswal last edited by

      Hi,
      Facing issue in websocket. here is my code.
      Output : Connected To websocket but not receiving any data.

      Also logged in Successfully and generated Token as well.

      let web_socket = new WebSocketClient({
      clientcode: CLIENT_CODE,
      jwttoken: JWT_TOKEN,
      apikey: API_KEY,
      feedtype: "order_feed",
      script:"nse_cm|11536"
      });

      web_socket.connect()
          .then(() => {
              var ACTION_TYPE = "subscribe";
              var FEED_TYPE = "order_feed";
              console.log("Connected to Web Socket");
              web_socket.fetchData(ACTION_TYPE,FEED_TYPE);  // ACTION_TYPE: subscribe | unsubscribe FEED_TYPE: order_feed
      
              setTimeout(function () {
                  web_socket.close()
              }, 60000)
          });
      
      web_socket.on('tick', receiveTick);
      
      
      function receiveTick(data) {
          console.log("receiveTick:::::", data);
      }
      
      A J 2 Replies Last reply Reply Quote 0
      • A
        admin @goutamjaiswal last edited by

        HI @goutamjaiswal Our team is working on this we will update you once fixed.

        O 1 Reply Last reply Reply Quote 0
        • O
          ommahato @admin last edited by

          @admin hi am also getting this issue any update on this ?

          A 1 Reply Last reply Reply Quote 0
          • A
            admin @ommahato last edited by

            Hi @ommahato Currently we dont have any update on this.

            1 Reply Last reply Reply Quote 0
            • J
              jety_22 @goutamjaiswal last edited by

              @goutamjaiswal Did you get any error named web_socket not defined?

              If yes then how did you solved it ?

              1 Reply Last reply Reply Quote 0
              • First post
                Last post