Websocket JSON-RPC

From Monocle Security
Revision as of 14:05, 7 December 2023 by Chris (talk | contribs) (Created page with "== Authenticate == echo '{"jsonrpc":"2.0","id":"id","params":{"username":"admin","password":"password"},"method":"authenticate"}' | ./websocat ws://127.0.0.1:9854/json <code>{"jsonrpc":"2.0","result":{"jwttoken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJleHAiOjE3MDE5ODU4MjksImlhdCI6MTcwMTg5OTQyOSwiaXNzIjoiYXV0aDAiLCJ1c2VydG9rZW4iOiIxIn0.x1_luycGY5oTfqGNy1SF8xqcqKGKr_hsXoDGsMjAJkA"},"id":"id"}</code> == Subscribe == echo '{"jsonrpc":"2.0","id":"id","params":{"jwttoken":"...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Authenticate

echo '{"jsonrpc":"2.0","id":"id","params":{"username":"admin","password":"password"},"method":"authenticate"}' | ./websocat ws://127.0.0.1:9854/json

{"jsonrpc":"2.0","result":{"jwttoken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJleHAiOjE3MDE5ODU4MjksImlhdCI6MTcwMTg5OTQyOSwiaXNzIjoiYXV0aDAiLCJ1c2VydG9rZW4iOiIxIn0.x1_luycGY5oTfqGNy1SF8xqcqKGKr_hsXoDGsMjAJkA"},"id":"id"}

Subscribe

echo '{"jsonrpc":"2.0","id":"id","params":{"jwttoken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJleHAiOjE3MDE5ODU4MjksImlhdCI6MTcwMTg5OTQyOSwiaXNzIjoiYXV0aDAiLCJ1c2VydG9rZW4iOiIxIn0.x1_luycGY5oTfqGNy1SF8xqcqKGKr_hsXoDGsMjAJkA"},"method":"subscribe"}' | ./websocat ws://127.0.0.1:9854/json

{"jsonrpc":"2.0","result":1,"id":"id","location":{"latitude":53.5815,"longitude":-2.1778},"files":[{"token":"1319756543","path":"D:\\file.dat","state":"Mounted","numchunks":4096,"chunksize":8388608,"automount":true}],"receivers":[{"token":"1","mediauri":"media://USBVideoDevice_MJPG_1920x1080","username":"","password":"","parameters":"StreamingProtocol=TCPInterleaved"}],"recordings":[{"tracks":[{"id":"10602418","token":"VIDEO2_10602418","description":"directshow","digitalSignature":false,"encrypt":false,"fixedFiles":false,"flushFrequency":60,"files":[],"totalTrackData":[]}],"jobs":[{"token":"6290858531577553758","enabled":true,"name":"MonocleJob","priority":1,"sources":[{"token":"6199715978532858218","receiverToken":"1","sourceTracks":[{"token":"3738472142918816058","trackid":10602418,"parameters":"Rotation=0","activeparameters":"","state":"Active","error":""}]}]}],"token":"6141235949812041025","location":"","name":"directshow","retentionTime":0,"activeJob":6290858531577553758}]}

{"jsonrpc":"2.0","method":"fileUnmounting","params":{"token":"1319756543"}}