18 lines
543 B
Bash
18 lines
543 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
response=$(curl -s -X 'POST' \
|
||
|
'http://localhost:8080/api/v1/player/login' \
|
||
|
-H 'accept: application/json' \
|
||
|
-H 'Content-Type: application/json' \
|
||
|
-d '{
|
||
|
"username": "Player1",
|
||
|
"password": "1234"
|
||
|
}')
|
||
|
|
||
|
token=$(echo "$response" | jq -r .token)
|
||
|
payload='{"$id": "RequestConnectionToken", "channel": "time"}'
|
||
|
response=$(echo "$payload" | websocat ws://localhost:8080/ws/connection -H "Authorization: $token")
|
||
|
|
||
|
time_token=$(echo "$response" | jq -r .token)
|
||
|
websocat ws://localhost:8080/ws/time -H "Authorization: $time_token"
|