unable to connetct to kiteAPI

jaspal52119
jaspal52119 edited December 2018 in General
Whenever I am trying to connect to the KiteTicker API for live quotes, I am getting below error:

ReactorNotRestartable
  • jaspal52119


    Alternatively, I am facing below error also:
    ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (None)
    ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (None)

    Please suggest
  • jaspal52119
    Connection closed: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)

    Here is the complete error and code.
    error:
    Connection closed: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)


    #################################
    CODE
    #################################
    from kiteconnect import KiteTicker
    tokens=[53703431,112129]
    kws=KiteTicker('API KEY','ACCESS TOKEN')


    def on_ticks(ws,ticks):
    insert_tick=insert_ticks(ticks)
    print(ticks)

    def on_connect(ws,response):
    ws.subscribe(tokens)
    ws.set_mode(ws.MODE_FULL,tokens)


    kws.on_ticks=on_ticks
    kws.on_connect=on_connect
    kws.connect()


  • sujith
    You can check out this thread.

    Please search the forum before posting queries. The same query has been answered many times on the forum.
Sign In or Register to comment.