Stream Connection
Fix SSE and WebSocket connection issues, disconnections, and common error messages in GEMTOK
GEMTOK uses Server-Sent Events (SSE) and WebSocket to receive real-time chat, gifts, likes, and viewer events from your live stream. These are persistent connections that stay open in your browser. If your internet is unstable or the browser throttles background tabs, the connection can drop.
This guide explains all error messages you might see and how to fix them.
How SSE and WebSocket Work in GEMTOK
You enter your username and click Connect.
GEMTOK server finds your RoomID and opens a persistent connection to TikTok / YouTube / Twitch.
Your browser keeps an SSE or WebSocket connection open to GEMTOK server to receive events in real-time.
If the connection drops, GEMTOK will automatically try to reconnect with exponential backoff.
A short disconnection (1-3 seconds) is normal and GEMTOK will auto-reconnect. If it keeps disconnecting every few minutes, check the causes below.
Why Connection Drops in Browser
| Cause | Explanation |
|---|---|
| Unstable Internet | WiFi packet loss, mobile data switching between 4G/5G, high ping. |
| Browser Background Throttling | Chrome/Edge pauses setTimeout and WebSocket when tab is minimized or behind OBS. |
| VPN / Proxy / Firewall | Corporate firewall, school WiFi, or VPN can block long-lived connections. |
| AdBlocker / Extensions | uBlock, AdGuard, Brave Shield can block SSE/WebSocket requests. |
| Antivirus / Windows Firewall | Some antivirus terminates persistent connections after 30-60s. |
| Server Idle Timeout | Some ISPs or proxies close idle connections after 60 seconds if no ping/pong. |
| Sleep / Power Saver | Laptop going to sleep or Memory Saver discarding the tab. |
Complete Error Message List
1. Connection & Network Errors
| Error Message | Cause | How to Fix |
|---|---|---|
Transport disconnected | No internet connection, or browser went offline. navigator.onLine === false. | Check WiFi/LAN cable. Disable airplane mode. Try ping 8.8.8.8 in terminal. Reconnect after internet is stable. |
Connection timeout / Connection timed out | Server didn't respond within 10-15s. High latency or server overloaded. | Check your internet speed at fast.com. If >150ms ping, switch to wired LAN. Wait 1 minute and retry. |
Network error / Failed to fetch / ERR_INTERNET_DISCONNECTED | Browser failed to make HTTP request for SSE handshake. | Reload page (Ctrl+R). Check if https://www.gemtok.live is accessible. Disable VPN temporarily. |
Failed to connect to server / ERR_CONNECTION_REFUSED | GEMTOK server unreachable or blocked by firewall. | Check if firewall/antivirus blocks gemtok.live. Whitelist it. Try mobile hotspot to confirm if ISP blocks. |
Browser is offline | Browser detected offline state. | Same as Transport disconnected. Check OS network icon. |
2. Username & Room Errors
| Error Message | Cause | How to Fix |
|---|---|---|
Target URL is too short | Username is too short (less than 2 characters) or you pasted an incomplete URL. | Enter full username without @. Example: charlidamelio not @charli. Don't paste TikTok video URL, use username only. |
RoomID not found | Username is invalid, private, or doesn't have live access. TikTok API returned no RoomID. | Double-check spelling. Make sure account is public and has LIVE access. Try searching username on TikTok web. |
The requested user isn't online | User exists but is not currently LIVE. | Start your live stream FIRST, then connect in GEMTOK. Wait 20-30s after going live before connecting. |
Live stream ended | Stream was live when you connected, but ended during session. | Restart your live. Reconnect in GEMTOK. This is normal when you end live. |
Something went wrong | Generic fallback - invalid username, invalid live URL, or TikTok changed API. | Re-enter username. Try with and without https://www.tiktok.com/@username/live. Update GEMTOK to latest version. Contact support if persists. |
User not found / Invalid username | TikTok user doesn't exist or was banned. | Verify username on TikTok app. If you changed username recently, use new one. |
3. SSE Specific Errors
| Error Message | Cause | How to Fix |
|---|---|---|
EventSource failed / SSE connection error / EventSource's response has a MIME type mismatch | Browser failed to establish SSE. Often caused by adblocker or proxy stripping text/event-stream header. | Disable adblocker for gemtok.live. In Brave, disable Shield. If behind corporate proxy, ask IT to allow text/event-stream. Try Chrome incognito. |
Stream closed unexpectedly | Server closed SSE stream without retry field. | GEMTOK will auto-reconnect. If loops, reload page. Check console for HTTP status code. |
Heartbeat timeout / Ping timeout | No ping received from server for 30-45s. ISP or proxy killed idle connection. | This is common on mobile data. Switch to stable WiFi/LAN. Disable battery saver. GEMTOK auto-reconnects, no action needed unless frequent. |
4. WebSocket Specific Errors
| Error Message | Cause | How to Fix |
|---|---|---|
WebSocket closed / WebSocket is closed before connection is established | Connection dropped before handshake finished. | Reload page. Check if wss:// is blocked by firewall. Some public WiFi blocks WebSocket. |
1006 Abnormal Closure | Most common WebSocket error. No close frame received - network cut, browser killed tab, or server crashed. | Check internet stability. Disable Memory Saver for GEMTOK tab at chrome://settings/performance. Keep tab visible, not minimized. |
1001 Going Away | Browser navigated away or tab was closed/discarded. | Don't close GEMTOK tab. Add site to "Always keep active" list in Chrome performance settings. |
1000 Normal Closure but keeps happening | Server intentionally closed connection, usually because live ended or session expired. | Reconnect manually. If it happens every 2-3 minutes while live is still on, report to support with console logs. |
Mixed Content: The page was loaded over HTTPS, but attempted to connect to insecure WebSocket ws:// | Browser blocks insecure ws:// on HTTPS page. | Make sure you access GEMTOK via https://www.gemtok.live, not http://. This should not happen in production, but can happen if using custom proxy. |
WebSocket error: ERR_CONNECTION_RESET | TCP connection reset by peer - antivirus, VPN, or ISP reset. | Disable antivirus web shield temporarily. Disconnect VPN. Try different network. |
5. Auth, Rate Limit & Server Errors
| Error Message | Cause | How to Fix |
|---|---|---|
Unauthorized / Session expired / Token expired / 401 | Login session expired or you logged out in another tab. | Logout and login again. Refresh page. If using PWA, close and reopen. |
Forbidden / 403 / Access denied | Your IP or account is blocked, or you don't have permission for this feature. | Check membership status. If free user trying premium feature, upgrade. Contact support if you think it's a mistake. |
Rate limited / Too many requests / 429 | Too many connect attempts in short time. TikTok also rate limits RoomID lookups. | Wait 2-5 minutes before retrying. Don't spam Connect button. GEMTOK has built-in cooldown. |
Server error / 500 Internal Server Error / 502 Bad Gateway / 503 Service Unavailable | GEMTOK server or upstream TikTok server error. | Wait 1-2 minutes and retry. Check GEMTOK Discord / status page. Usually temporary. |
CORS error / Blocked by CORS policy | Browser blocked request due to CORS. Usually caused by extension or custom proxy. | Disable extensions. Don't use third-party proxy that modifies headers. Try incognito mode. |
How to Diagnose
Open DevTools Console
Press F12 or Ctrl+Shift+J > Go to Console tab. Look for red errors when connection fails. Screenshot it for support.
Check Network Tab
F12 > Network tab > Filter by WS (WebSocket) or Fetch/XHR for SSE. Reload and connect. Click the failed request to see Status Code and Response. 101 for WebSocket is success, 200 for SSE is success. 4xx/5xx indicates error.
Test in Incognito
Open Ctrl+Shift+N incognito window, go to GEMTOK, and connect. If it works there, an extension is causing it. Disable adblocker, VPN extension, or privacy extensions one by one.
Test Different Network
Try mobile hotspot. If hotspot works but WiFi doesn't, your ISP / router / firewall blocks SSE/WebSocket. Restart router, or whitelist *.gemtok.live.
Best Practices for Stable Connection
Use Wired LAN, Not WiFi
Ethernet is 10x more stable than WiFi for long-lived connections. If you must use WiFi, stay close to router and use 5GHz band.
Keep GEMTOK Tab Active and Visible
Don't minimize. Pop out to separate window. Disable Memory Saver: chrome://settings/performance > Add https://www.gemtok.live to "Always keep these sites active". See Game Paused guide for details.
Whitelist GEMTOK
In adblocker (uBlock Origin, AdGuard): Add gemtok.live to trusted sites.
In antivirus: Add exception for gemtok.live.
In Windows Firewall: Allow Chrome/Edge.
Avoid VPN / Proxy for Streaming
If you need VPN, use split tunneling and exclude Chrome / GEMTOK from VPN. Some VPNs kill idle WebSocket after 60s.
Keep Browser Updated
Use latest Chrome or Edge. Old browsers have buggy WebSocket implementations. Chrome 110+ recommended.
Don't Spam Reconnect
If connection fails, wait 5-10 seconds before clicking Connect again. Spamming triggers rate limit (429) and makes it worse. Let auto-reconnect do its job.
Still Not Working?
If you see 1006 Abnormal Closure or Transport disconnected more than 5 times in 10 minutes, your internet is unstable. Fix your network first before reporting bug - GEMTOK cannot maintain connection if underlying internet drops.