Websocket On Bash
2014-01-18 02:02
260 查看
echo -ne "HTTP/1.1 101 Switching Protocols\r\n" >> resp
echo -ne "Upgrade: websocket\r\nConnection: Upgrade\r\n" >> resp
echo -ne "Sec-WebSocket-Accept: key\r\n" >> resp
echo -ne "\r\n" >> resp
[Server] { coproc P { nc -l 8888; } >&3; } 3>&1
[Client] var ws = new WebSocket("ws://localhost:8888/echo");
[Server] echo -n ${key}258EAFA5-E914-47DA-95CA-C5AB0DC85B11 | openssl dgst -sha1 -binary | base64
[Server] e /tmp/resp
[Server] cat /tmp/resp >&${P[1]}
[Client] ws.send("shit")
echo -ne "Upgrade: websocket\r\nConnection: Upgrade\r\n" >> resp
echo -ne "Sec-WebSocket-Accept: key\r\n" >> resp
echo -ne "\r\n" >> resp
[Server] { coproc P { nc -l 8888; } >&3; } 3>&1
[Client] var ws = new WebSocket("ws://localhost:8888/echo");
[Server] echo -n ${key}258EAFA5-E914-47DA-95CA-C5AB0DC85B11 | openssl dgst -sha1 -binary | base64
[Server] e /tmp/resp
[Server] cat /tmp/resp >&${P[1]}
[Client] ws.send("shit")
相关文章推荐
- something about saving socket resource(basing on WebChat:微信红包)
- websocket server base on go language
- SLF4J: Failed toString() invocation on an object of type [org.eclipse.jetty.websocket.server......
- Java WebSocket客户端java WebSocketClient
- Spring+Websocket+Redis
- How To: Set Up SSL on a Web Server
- web.xml中load-on-startup的作用
- 配置Outlook On The Web http 到https的重定向
- WEB failsafe mode implements on WRTNode(MT7620N)
- Building an IIS web server on a home LAN
- web.xml中load-on-startup的作用
- web.xml中 load-on-startup 有哪些作用?
- NB65 Web Docs were published on zh-ch.netbeans.org
- web.xml中load-on-startup的作用
- 基于quartz,redis,socket.io的web实时消息推送
- web.xml is missing and <failOnMissingWebXml> is set to true 错误解决办法
- springboot实现服务器端消息推送(websocket + sockjs + stomp)
- socket: Socket operation on non-socket
- 关于web.config配置文件里面的 mode的各种含义,mode="RemoteOnly",mode="On",mode="Windows"
- JavaWeb: 报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path