I am trying to implement websocket on ESP8266 using AT Commands, and sending following commands:
AT+CIPSTART = "TCP","My_IP_Address", 80
Response is OK
AT+CIPSEND = length_of Data\r\n
Response is OK >
GET ws://My_IP_Address/ HTTP/1.1
Origin: http://My_IP_Address\r\n
Connection: Upgrade\r\n
Host: My_IP_Address\r\n
Upgrade: websocket\r\n
\r\n
Response is as follows:
+IPD,325:HTTP/1.1 400 Bad Request
Server: nginx/1.10.2
Date: Sat, 05 Aug 2017 16:04:12 GMT
Content-Type: text/html
Content-Length: 173
Connection: close
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.10.2</center>
</body>
</html>
CLOSED
I am getting following response:
Please tell me what's going wrong?
Thanks Gyanesh
GETon the URLhttp://myipaddress/, notws://..Use "inspect element" on some test page (e.g. websocket.org/echo.html) and look at the requests. Also en.wikipedia.org/wiki/WebSocket#Protocol_handshake .