Navigation

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

    Websocket gives 401

    NodeJS SDK
    0
    1
    1
    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.
    • A
      avinash256shinde last edited by

      I am setting live market data, by going through README.md file https://github.com/angel-one/smartapi-java/blob/main/README.md#websocket-live-streaming-data

      but it returns following error

      Error connecting to WebSocket: The status code of the opening handshake response is not '101 Switching Protocols'. The status line is: HTTP/1.1 401 Unauthorized
      
      

      I am generating session using following code, and I do get FeedToken as well as JwtToken and refreshToken, so I think following part is correct.

      User user = smartConnect.generateSession(clientCode, "<password>", "<totp>");
      String feedToken = user.getFeedToken();
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post