Dracula
Dracula
Explore posts from servers
NNuxt
Created by Dracula on 6/16/2024 in #❓・help
in defineWebSocketHandler how to allow authenticated users connecting?
what i seen most of the time in upgrade you can stop from connecting lets say if user has cookie. thanks for the help.
upgrade(req) {
console.log(this)
let session = '';
const cookies = req.headers.cookie.split(';') as string[];
cookies.forEach(el => {
if(el.includes('session=')) session = el.split('session=')[1].trim();
})

if(session == '') {
// socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n');
// socket.destroy();
return;
}

return {headers: {}};
},
upgrade(req) {
console.log(this)
let session = '';
const cookies = req.headers.cookie.split(';') as string[];
cookies.forEach(el => {
if(el.includes('session=')) session = el.split('session=')[1].trim();
})

if(session == '') {
// socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n');
// socket.destroy();
return;
}

return {headers: {}};
},
1 replies
CDCloudflare Developers
Created by Dracula on 4/26/2024 in #general-help
nuxt3 Requests today
i using nuxt3 with ssr if i cache routes do they still count as request? and if i get paid plan can i cap limit of how much i spend?
2 replies
RRailway
Created by Dracula on 9/2/2023 in #✋|help
Pricing question
i got 10 eur in credits because that lowest i could go and got hobby plan 5 eur a month, but after month it says i don't have any more money left?🤔
11 replies