Add some logging around the users and chat.
This commit is contained in:
parent
f6947f32f1
commit
8b55e01bfa
@ -14,8 +14,7 @@ const { upgradeWebSocket, websocket } = createBunWebSocket<ServerWebSocket>();
|
|||||||
app.get("/chat-service", upgradeWebSocket((c) => {
|
app.get("/chat-service", upgradeWebSocket((c) => {
|
||||||
return {
|
return {
|
||||||
onOpen(event, ws) {
|
onOpen(event, ws) {
|
||||||
console.log(ws);
|
console.log(`Connection established from ${ws.raw.remoteAddress}`);
|
||||||
console.log(`Connection established ${event}`);
|
|
||||||
|
|
||||||
chatRoom.addListener('message-added', async function (e) {
|
chatRoom.addListener('message-added', async function (e) {
|
||||||
const message = JSON.stringify({
|
const message = JSON.stringify({
|
||||||
|
Loading…
Reference in New Issue
Block a user