Send a message and I'll reply in real time - I get pinged straight to Discord. This is still a work in progress, so expect some rough edges.

Description

Talk2Me is a small live chat room embedded directly into this portfolio via an iframe. Anyone can drop in, give a nick name, and send me a message without creating an account. I get notified instantly and can reply from Discord, so the conversation happens in real time even though I'm never actually on this page myself.

The chat room itself is a separate app hosted on its own domain (website4u.vn), so it can run its own backend independently of this static GitHub Pages site. This page just embeds that app in an iframe. It's a fully responsive page rather than a fixed mobile-sized view, so it renders correctly at whatever size the iframe is given, from a small popup-style box up to a full desktop window.

Messages sent from the chat get relayed to a private Discord channel through a webhook/bot, so I can see and reply to them from my phone or desktop without needing to keep this page open.

Since it's open to anyone with no login, it's built to hold up against bots and abuse on its own: new conversations are rate-limited per IP (max 5 per hour) with a site-wide daily cap as a backstop against spam spread across many IPs, and each thread is slowmode-limited to one message every few seconds. A thread also starts locked: a visitor can type, but nothing actually sends until I've replied at least once, so a bot can get at most one message into Discord before being cut off, rather than flooding a thread nobody's watching yet.

Session tokens are signed (HMAC) server-side, so a visitor can't forge or guess their way into someone else's conversation, and there's no database behind any of it either. A conversation's entire state lives in its Discord thread, so there's nothing to breach beyond that. Once the session is inactive for 8h, the chat session ID will be automatically forgetten. Meaning I will no longer be able to reach out to you unknown stranger. That chat history however, will still be retained on Discord side, until I decided to free it up.The embed itself is locked down too: the chat page only renders inside an iframe on domains I've explicitly approved from website4u.vn, so it can't be silently framed on some other site.

  • No account needed: just a nick name, then type and send.
  • Real-time relay: messages reach me through Discord within a few seconds of being sent.
  • Reply-gated input: a visitor can draft messages right away, but sending is held until I've replied at least once, which keeps the thread from filling up one-sided before anyone's actually watching.
  • Spam/rate limiting: a short cooldown between messages, an hourly send limit, and a daily cap on brand-new conversations.
  • Persistent per-visitor session: a visitor's conversation and unread badge survive a page reload (stored in their own browser), and quietly expires after 8 hours of inactivity.
  • Open as page: the chat isn't just an iframe fragment. It's a full standalone page, so it also works opened directly in its own tab, not only embedded.
  • Online/offline status so visitors know if I'm actively watching Discord.