R Websocket: Server handshake response error: websocketpp.processor:20 (Invalid HTTP status.)

kiranganji99
Hi All,

I am trying to connect to the websocket streaming through R. However, I am facing the following error when I try to connect.
Server handshake response error: websocketpp.processor:20 (Invalid HTTP status.)

Here's my code to connect

header_socket <- list(api_key=connection_object@api_key, access_token=connection_object@access_token)
ws <- WebSocket$new("wss://ws.kite.trade",headers = header_socket)


Any help will be appreciated on how to fix this error in R.

Thanks in advance.
  • rakeshr
    Server handshake response error: websocketpp.processor:20 (Invalid HTTP status.)
    This GitHub issue comment could help.
  • kiranganji99
    Thanks @rakeshr . Found the issue. There should be a "/" after the trade(in the websocket url). And the headers don't work. Entire url has to be provided with the api_key and access_token :)
This discussion has been closed.