curl模拟测试 libwebsocket服务端程序

用cmake .  make编译 libwebsocket的测试程序,  运行 bin/libwebsockets-test-server


用网页打开 http://192.168.1.194:7681/   可以看到测试程序

curl模拟测试 libwebsocket服务端程序_第1张图片


用commview 抓包

curl模拟测试 libwebsocket服务端程序_第2张图片


CURL 模拟发送:


curl -i -N \
-H "GET /xxx HTTP/1.1" \
-H "Host: 192.168.1.194:7681" \
-H "Connection: Upgrade" \
-H "Pragma: no-cache" \
-H "Cache-Control: no-cache" \
-H "Upgrade: websocket" \
-H "Origin: http://192.168.1.194:7681" \
-H "Sec-WebSocket-Version: 13" \
-H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36" \
-H "Accept-Encoding: gzip, deflate, sdch" \
-H "Accept-Language: zh-CN,zh;q=0.8" \
-H "Cookie: test=LWS_1467015783_202369_COOKIE" \
-H "Sec-WebSocket-Key: HQZPuX/AaPXjxPs4qms8ew==" \
-H "Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits" \
-H "Sec-WebSocket-Protocol: dumb-increment-protocol" \
http://192.168.1.194:7681/xxx


curl模拟测试 libwebsocket服务端程序_第3张图片


你可能感兴趣的:(websockets)