var bla;
fetch('/ws-auth', {
credentials: 'same-origin',
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' },
body: `fkey=${fkey().fkey}&roomid=17`
}).then(res => res.json()).then(({url}) => bla = new WebSocket(url));
bla.addEventListener('message', function (event) {
json = JSON.parse(even.data);
alert(json.content);
});