Skip to content

Instantly share code, notes, and snippets.

@ramene
Created January 12, 2018 16:44
Show Gist options
  • Save ramene/57ad605d7cbf73d373afbf0579bc2c8c to your computer and use it in GitHub Desktop.
Save ramene/57ad605d7cbf73d373afbf0579bc2c8c to your computer and use it in GitHub Desktop.
curl websocket
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
@ramene
Copy link
Author

ramene commented Jan 12, 2018

The purpose of the key, the one supplied here should work.
The pourpose of that header is to prevent caching of websocket requests.

See https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment