Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var token = JSON.parse(await (await fetch('https://ok.ru/web-api/messages2/credentials', {method: "POST"})).text()).token;
- var ws = new WebSocket('wss://tamtam-ws.ok.ru/websocket?okweb=true&autoinit=true&version=1.0.127');
- ws.onopen = function() {
- ws.send(`{"ver":10,"cmd":0,"seq":3,"opcode":23,"payload":{"token":"${token}","tokenType":"OKWEB","deviceType":"OKWEB","deviceId":"OKWEB:1"}}`);
- console.log('ok');
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement