Error while using websocket

darsh
darsh edited April 2018 in Python client
My code

from kiteconnect import KiteConnect
api_key="xxxx"
api_secret="xxxx"
kite=KiteConnect(api_key)
access_token='xxxx'
import socket
s= socket.socket(socket.AF_INET,socket.SOCK_STREAM)
server="wss://ws.kite.trade?api_key=xxxx&access_token=xxxx"
port=80
s.connect((server,port))



When i try to connect with server,i get this error code"[Errno 11001] getaddrinfo failed"
I am trying to get LTP by using websocket. Please help me to resolve this issue.
  • sujith
    You can check out example here.
  • darsh
    Are you suggesting to use "PORT = 5010 ,HOST = "127.0.0.1" instead of "server="wss://ws.kite.trade?api_key=xxxx&access_token=xxxx",port=80 ?

    sorry i can not find any example related to socket and or socket.connect()?,
  • sujith
    You can go to readme and check out example. You need to use Kite Ticker and not socket.
This discussion has been closed.