Skip to content

Instantly share code, notes, and snippets.

@iocanel
Last active December 16, 2015 13:27
Show Gist options
  • Save iocanel/b2beba1022fa011d4684 to your computer and use it in GitHub Desktop.
Save iocanel/b2beba1022fa011d4684 to your computer and use it in GitHub Desktop.
Helper script for using curl with kubernetes ws
#!/bin/bash
KUBE_TOKEN=`cat ~/.kube/config | grep token | awk -F " " '{print $2}'`
curl -sSk -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" \
-H "Sec-WebSocket-Key: MKuU3hrynEXL1F00D3ZyOQ==" \
-H "Sec-WebSocket-Version: 13" \
-H "Authorization: Bearer $KUBE_TOKEN" $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment