2

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

1

1 Answer 1

-1

GET / HTTP/1.1\r\n Host: My_IP_Address\r\n Connection: Upgrade\r\n Upgrade: websocket\r\n\r\n

instead of GET ws://My_IP_Address/ HTTP/1.1 Origin: http://My_IP_Address Connection: Upgrade\r\n Host: My_IP_Address\r\n Upgrade: websocket\r\n

Try...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.