aws ssm start-session returns url and token to open WebSocket Connection. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_StartSession.html#API_StartSession_ResponseSyntax
Tried a client to open WebSocket connection: https://hashrocket.com/blog/posts/development-of-a-simple-command-line-websocket-client
But I am getting following error when trying to send input like {"type": "echo", "payload": "whoami"}
websocket: close 1003 (unsupported data): Channel : request to open data channel does not contain token.
I tried setting headers with multiple options like
headers := make(http.Header)
headers.Add("Authorization", "Bearer " + token)
headers.Add("token_type", "bearer")
headers.Add("access_token", token)
headers.Add("token", token)
headers.Add("Authentication", token)
// "github.com/gorilla/websocket"
ws, _, err := websocket.DefaultDialer.Dial(url, headers)
Most of the code is same as in 2nd link mentioned above except trying for wss (not ws).
I guess I am missing something in header. Any idea? Thx
Expected Behavior: Should be able to send requests (like above) and get responses successfully.