SocketEventsHandler disconnected("invalid origin", 1008)

I have tried connect LG tv using web socket but showing invalid origin issue and not able to connect can you guide me what is issue?

Please do not run a websocket server on your TV. You should run it on your server and use the TV as a client only. Thank you.