开发者工具

WebSocket 转 cURL

将 WebSocket 连接转换为 cURL 握手、wscat、websocat、JavaScript 或 Python 代码

WebSocket connection
.sh
curl -i -N 'https://echo.websocket.org' \
  -H 'Connection: Upgrade' \
  -H 'Upgrade: websocket' \
  -H 'Origin: https://echo.websocket.org' \
  -H 'Sec-WebSocket-Version: 13' \
  -H 'Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==' \
  -H 'Authorization: Bearer YOUR_TOKEN'

The cURL output is the raw HTTP Upgrade handshake (RFC 6455). Use it to verify the server returns 101 Switching Protocols. cURL itself doesn't speak the WebSocket frame protocol after the handshake — for that, switch to wscat or websocat.

没找到需要的?

我们根据社区反馈开发免费工具。欢迎提出能改善您工作流的工具建议!

WebSocket 转 cURL — 免费工具在线 | FreeTool24 | FreeTool24