Navigation

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

    Not able to connect to WebSocket

    General Discussion
    websocket
    2
    5
    79
    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.
    • M
      MyAgent last edited by

      Hi @admin , I tried connecting to WS but getting below response:

      {
      "ak": "nk",
      "task": "cn",
      "msg": "cn"
      }
      Input Parameters:
      WS url : wss://omnefeeds.angelbroking.com/NestHtml5Mobile/socket/stream
      Req : {"task":"cn","channel":"","token":"Generated Feed Token","user":"VIYV1028","acctid":"VIYV1028"}

      Am I doing anything wrong or WebSocket connections only allowed during market hours?

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

        HI @jax248 You will only get the data during market hours.

        M 2 Replies Last reply Reply Quote 0
        • M
          MyAgent @admin last edited by

          @admin Thanks. Will check on Monday then.

          1 Reply Last reply Reply Quote 0
          • M
            MyAgent @admin last edited by MyAgent

            @admin Hi..still getting same issue. I am using below JS code.

                        var ws =new  websocket('VIYV1028', 'XXXXXXXX');
                        
                        //connect to server
                        ws.connection();
                        //add callback after socket connection
                        ws.on('connect', connectionOpen);
                        function connectionOpen(){   
                         ws.runScript("nse_cm|2885", "mw");
                          // SCRIPT: exchange|token for multi stocks use & seperator, mcx_fo|222900  ### TASK: mw|sfi|dp
                        }
                        
                        //add callback method where you can manipulate socket data
                        ws.on('tick', receiveTick);
                        
                        //user defined function
                        function receiveTick(data) {
                            console.log(data);
                            if (data.length == 0) {
                                 ws.close();
                            }
                        }
            
            A 1 Reply Last reply Reply Quote 0
            • A
              admin @MyAgent last edited by

              HI @jax248 Our team is working on web socket we will update you once we fix this.

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