Skip to content

Instantly share code, notes, and snippets.

@waggertron
Last active March 17, 2026 10:26
Show Gist options
  • Select an option

  • Save waggertron/b2389f64f907e88fa0c10df8541b6d70 to your computer and use it in GitHub Desktop.

Select an option

Save waggertron/b2389f64f907e88fa0c10df8541b6d70 to your computer and use it in GitHub Desktop.
Weyflix Connection Diagnostic - Windows (double-click weyflix-diagnose.bat to run)
@echo off
REM
REM Weyflix Connection Diagnostic (Windows)
REM
REM HOW TO RUN:
REM Just double-click this file!
REM Enter the server IP when prompted.
REM Results will be saved to your Desktop.
REM Send the results file back so we can fix your issue.
REM
echo ========================================
echo Weyflix Connection Diagnostic
echo ========================================
echo.
echo The server admin should have given you an IP address.
echo It looks something like: 73.162.45.100
echo.
set /p SERVER_IP="Enter the server IP (xxx.xxx.xxx.xxx): "
if "%SERVER_IP%"=="" (
echo.
echo [ERROR] No IP address entered. Please try again.
pause
exit /b 1
)
echo.
echo Downloading diagnostic script...
PowerShell.exe -ExecutionPolicy Bypass -Command ^
"$url = 'https://gist.githubusercontent.com/waggertron/b2389f64f907e88fa0c10df8541b6d70/raw/weyflix-diagnose.ps1'; " ^
"$script = Join-Path $env:TEMP 'weyflix-diagnose.ps1'; " ^
"Invoke-WebRequest -Uri $url -OutFile $script -UseBasicParsing; " ^
"& $script -ServerIP '%SERVER_IP%'; " ^
"Remove-Item $script -ErrorAction SilentlyContinue"
if %ERRORLEVEL% NEQ 0 (
echo.
echo [ERROR] Something went wrong. Make sure you have internet access.
echo.
)
pause
#
# Weyflix Connection Diagnostic (Windows)
#
# HOW TO RUN:
# Option 1: Double-click weyflix-diagnose.bat (easiest — prompts for IP)
# Option 2: Right-click this file → Run with PowerShell (prompts for IP)
# Option 3: From PowerShell:
# Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
# .\weyflix-diagnose.ps1 -ServerIP "<server-public-ip>"
#
# Replace <server-public-ip> with the IP address provided by the Weyflix admin.
#
param(
[string]$ServerIP
)
$PLEX_PORT = 32400
Write-Host ""
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " Weyflix Connection Diagnostic" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
# Resolve server IP: parameter > saved env var > prompt
if (-not $ServerIP) {
# Check for previously saved IP
$savedIP = [Environment]::GetEnvironmentVariable("WEYFLIX_SERVER_IP", "User")
if ($savedIP) {
Write-Host " Found saved server IP: $savedIP" -ForegroundColor Cyan
Write-Host ""
$confirm = Read-Host " Is this correct? (y/n)"
$confirm = $confirm.Trim().ToLower()
if ($confirm -eq "y" -or $confirm -eq "yes") {
$ServerIP = $savedIP
} else {
Write-Host ""
Write-Host " OK, enter the correct IP below." -ForegroundColor White
Write-Host " It looks something like: 73.162.45.100" -ForegroundColor Gray
Write-Host ""
$ServerIP = Read-Host " Enter the server IP (xxx.xxx.xxx.xxx)"
}
} else {
Write-Host "The server admin should have given you an IP address." -ForegroundColor White
Write-Host "It looks something like: 73.162.45.100" -ForegroundColor Gray
Write-Host ""
$ServerIP = Read-Host "Enter the server IP (xxx.xxx.xxx.xxx)"
}
}
# Sanitize: trim whitespace and strip newlines/carriage returns
$ServerIP = ($ServerIP -replace '[\r\n]', '').Trim()
if (-not $ServerIP) {
Write-Host ""
Write-Host "[ERROR] No IP address entered." -ForegroundColor Red
Write-Host ""
Write-Host " Please re-run the script and enter the IP address" -ForegroundColor Yellow
Write-Host " that was provided to you (e.g. 73.162.45.100)" -ForegroundColor Yellow
Write-Host ""
Read-Host "Press Enter to exit"
exit 1
}
# Validate IP format (IPv4: 1-3 digits separated by dots, 4 octets)
if ($ServerIP -notmatch '^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$') {
Write-Host ""
Write-Host "[ERROR] '$ServerIP' doesn't look like a valid IP address." -ForegroundColor Red
Write-Host ""
Write-Host " An IP address looks like: 73.162.45.100" -ForegroundColor Yellow
Write-Host " (four groups of numbers separated by dots)" -ForegroundColor Yellow
Write-Host ""
Write-Host " Make sure you're entering the IP address, not a website URL." -ForegroundColor Yellow
Write-Host " Don't include http:// or any slashes." -ForegroundColor Yellow
Write-Host ""
Read-Host "Press Enter to exit"
exit 1
}
# Check if user entered a private/local IP range
if ($ServerIP -match '^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)') {
Write-Host ""
Write-Host "[WARNING] '$ServerIP' is a local/private IP address." -ForegroundColor Red
Write-Host ""
Write-Host " That's an internal network address (like a home Wi-Fi address)." -ForegroundColor Yellow
Write-Host " For remote access, you need the server's PUBLIC IP address." -ForegroundColor Yellow
Write-Host " Ask the server admin for the correct public IP and try again." -ForegroundColor Yellow
Write-Host ""
Read-Host "Press Enter to exit"
exit 1
}
# Check if user entered their own IP by mistake (local or public)
$localIPs = Get-NetIPAddress -AddressFamily IPv4 -ErrorAction SilentlyContinue |
Where-Object { $_.IPAddress -notlike "127.*" } |
Select-Object -ExpandProperty IPAddress
$myPublicCheck = try { (Invoke-WebRequest -Uri "https://api.ipify.org" -UseBasicParsing -TimeoutSec 5 -ErrorAction Stop).Content } catch { $null }
if ($myPublicCheck) { $localIPs += $myPublicCheck }
if ($localIPs -contains $ServerIP) {
Write-Host ""
Write-Host "[WARNING] '$ServerIP' is YOUR IP address, not the server's." -ForegroundColor Red
Write-Host ""
Write-Host " You entered your own IP address by mistake." -ForegroundColor Yellow
Write-Host " You need the Weyflix SERVER's IP address, not your own." -ForegroundColor Yellow
Write-Host " Ask the server admin for the correct IP and try again." -ForegroundColor Yellow
Write-Host ""
Read-Host "Press Enter to exit"
exit 1
}
# Save IP for future runs
[Environment]::SetEnvironmentVariable("WEYFLIX_SERVER_IP", $ServerIP, "User")
$SERVER_PUBLIC_IP = $ServerIP
Write-Host ""
Write-Host " Target server: $SERVER_PUBLIC_IP" -ForegroundColor Cyan
Write-Host ""
# ── OUTPUT SETUP ──
$outputFile = "$env:USERPROFILE\Desktop\weyflix-diagnostic-$(Get-Date -Format 'yyyyMMdd-HHmmss').txt"
function Log {
param([string]$msg, [string]$color = "White")
Write-Host $msg -ForegroundColor $color
$msg | Out-File -FilePath $outputFile -Append -Encoding utf8
}
function LogSection {
param([string]$title)
Log ""
Log "============================================"
Log " $title"
Log "============================================"
}
# Clear screen
Clear-Host
Log "========================================================" "Cyan"
Log " WEYFLIX CONNECTION DIAGNOSTIC" "Cyan"
Log " $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')" "Gray"
Log "========================================================" "Cyan"
Log ""
# ── 1. YOUR IDENTITY ──
LogSection "1. YOUR COMPUTER"
Log " Computer Name : $env:COMPUTERNAME"
Log " Username : $env:USERNAME"
Log " OS : $((Get-CimInstance Win32_OperatingSystem).Caption)"
# Get local IP
$adapter = Get-NetAdapter | Where-Object { $_.Status -eq "Up" } | Select-Object -First 1
if ($adapter) {
$localIP = (Get-NetIPAddress -InterfaceIndex $adapter.ifIndex -AddressFamily IPv4 -ErrorAction SilentlyContinue | Select-Object -First 1).IPAddress
$gateway = (Get-NetRoute -InterfaceIndex $adapter.ifIndex -DestinationPrefix "0.0.0.0/0" -ErrorAction SilentlyContinue | Select-Object -First 1).NextHop
$dns = (Get-DnsClientServerAddress -InterfaceIndex $adapter.ifIndex -AddressFamily IPv4 -ErrorAction SilentlyContinue).ServerAddresses -join ", "
Log " Adapter : $($adapter.Name) ($($adapter.InterfaceDescription))"
Log " Speed : $($adapter.LinkSpeed)"
Log " Local IP : $localIP"
Log " Gateway : $gateway"
Log " DNS Servers : $dns"
} else {
Log " [PROBLEM] No active network adapter found!" "Red"
}
# ── 2. YOUR PUBLIC IP ──
LogSection "2. YOUR PUBLIC IP"
Log " Finding your public IP address..."
try {
$myPublicIP = (Invoke-WebRequest -Uri "https://api.ipify.org" -UseBasicParsing -TimeoutSec 10).Content
Log " Your public IP: $myPublicIP" "Green"
} catch {
Log " [PROBLEM] Cannot determine your public IP" "Red"
Log " This usually means you have no internet connection" "Yellow"
$myPublicIP = "UNKNOWN"
}
# ── 3. INTERNET CONNECTION ──
LogSection "3. INTERNET CONNECTION"
$internetTests = @(
@{ Name = "Google"; URL = "https://www.google.com" },
@{ Name = "Plex.tv"; URL = "https://plex.tv" },
@{ Name = "Apple"; URL = "https://www.apple.com" }
)
$internetOK = $false
foreach ($test in $internetTests) {
try {
$r = Invoke-WebRequest -Uri $test.URL -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop
Log " [OK] $($test.Name) - reachable (HTTP $($r.StatusCode))" "Green"
$internetOK = $true
} catch {
Log " [PROBLEM] $($test.Name) - cannot reach" "Red"
}
}
if (-not $internetOK) {
Log ""
Log " >>> DIAGNOSIS: You have no internet connection. <<<" "Red"
Log " >>> Fix your internet first, then try Weyflix again. <<<" "Red"
Log ""
Log "Results saved to: $outputFile"
Read-Host "Press Enter to exit"
exit
}
# ── 4. DNS RESOLUTION ──
LogSection "4. DNS RESOLUTION"
$dnsTests = @("plex.tv", "app.plex.tv", "google.com")
$dnsOK = $true
foreach ($domain in $dnsTests) {
try {
$resolved = (Resolve-DnsName $domain -ErrorAction Stop | Where-Object { $_.QueryType -eq "A" } | Select-Object -First 1).IPAddress
Log " [OK] $domain -> $resolved" "Green"
} catch {
Log " [PROBLEM] $domain - DNS resolution FAILED" "Red"
$dnsOK = $false
}
}
if (-not $dnsOK) {
Log ""
Log " >>> DIAGNOSIS: DNS is not working properly. <<<" "Yellow"
Log " >>> Try changing your DNS servers to 1.1.1.1 and 8.8.8.8 <<<" "Yellow"
Log " >>> Instructions:" "Yellow"
Log " >>> 1. Open Settings > Network & Internet > Change adapter options" "Yellow"
Log " >>> 2. Right-click your connection > Properties" "Yellow"
Log " >>> 3. Select 'Internet Protocol Version 4' > Properties" "Yellow"
Log " >>> 4. Select 'Use the following DNS server addresses'" "Yellow"
Log " >>> 5. Enter: 1.1.1.1 and 8.8.8.8" "Yellow"
Log " >>> 6. Click OK" "Yellow"
}
# ── 5. DIRECT SERVER CONNECTION ──
LogSection "5. DIRECT SERVER CONNECTION"
Log " Testing connection to Weyflix server at $SERVER_PUBLIC_IP`:$PLEX_PORT..."
Log ""
# TCP port test
try {
$portTest = Test-NetConnection -ComputerName $SERVER_PUBLIC_IP -Port $PLEX_PORT -WarningAction SilentlyContinue
if ($portTest.TcpTestSucceeded) {
Log " [OK] Port $PLEX_PORT is OPEN and reachable" "Green"
Log " Latency: $($portTest.PingReplyDetails.RoundtripTime)ms"
} else {
Log " [PROBLEM] Port $PLEX_PORT is BLOCKED or UNREACHABLE" "Red"
if ($portTest.PingSucceeded) {
Log " Server responds to ping but port $PLEX_PORT is closed" "Yellow"
Log " This means a firewall or router is blocking the port" "Yellow"
} else {
Log " Server does not respond to ping either" "Yellow"
Log " Server may be offline, or all traffic is blocked" "Yellow"
}
}
} catch {
Log " [PROBLEM] Connection test failed: $($_.Exception.Message)" "Red"
}
# Plex API test
Log ""
Log " Testing Plex API..."
try {
$sw = [System.Diagnostics.Stopwatch]::StartNew()
$api = Invoke-WebRequest -Uri "http://${SERVER_PUBLIC_IP}:${PLEX_PORT}/identity" -UseBasicParsing -TimeoutSec 15 -ErrorAction Stop
$sw.Stop()
Log " [OK] Plex API responding (HTTP $($api.StatusCode), $($sw.ElapsedMilliseconds)ms)" "Green"
if ($api.Content -match 'version="([^"]+)"') {
Log " Server version: $($Matches[1])"
}
} catch {
if ($_.Exception.Message -match "timed out|timeout") {
Log " [PROBLEM] Plex API TIMED OUT" "Red"
Log " The port is likely blocked by a firewall or ISP" "Yellow"
} elseif ($_.Exception.Message -match "refused|actively refused") {
Log " [PROBLEM] Connection REFUSED" "Red"
Log " Port is reachable but Plex is not responding on it" "Yellow"
} else {
Log " [PROBLEM] Plex API unreachable: $($_.Exception.Message)" "Red"
}
}
# ── 6. PING TEST ──
LogSection "6. PING TEST (latency & packet loss)"
Log " Sending 10 pings to $SERVER_PUBLIC_IP..."
$pingResults = Test-Connection -ComputerName $SERVER_PUBLIC_IP -Count 10 -ErrorAction SilentlyContinue
if ($pingResults) {
$avg = [math]::Round(($pingResults | Measure-Object -Property Latency -Average).Average, 1)
$min = ($pingResults | Measure-Object -Property Latency -Minimum).Minimum
$max = ($pingResults | Measure-Object -Property Latency -Maximum).Maximum
$received = $pingResults.Count
$loss = 10 - $received
$lossPct = $loss * 10
Log " Received : $received/10 ($lossPct% loss)"
Log " Latency : min=${min}ms, avg=${avg}ms, max=${max}ms"
if ($lossPct -gt 0) {
Log " [PROBLEM] Packet loss detected ($lossPct%)" "Yellow"
}
if ($avg -gt 150) {
Log " [PROBLEM] High latency (${avg}ms) - streaming quality will be poor" "Yellow"
} elseif ($avg -gt 50) {
Log " [OK] Latency is moderate (${avg}ms) - should work for streaming" "Green"
} else {
Log " [OK] Latency is good (${avg}ms)" "Green"
}
} else {
Log " [PROBLEM] All pings failed - server may block ICMP or be offline" "Yellow"
Log " (This doesn't necessarily mean Plex won't work)" "Gray"
}
# ── 7. TRACEROUTE ──
LogSection "7. NETWORK PATH (traceroute)"
Log " Tracing route to $SERVER_PUBLIC_IP (this takes 30-60 seconds)..."
$tracert = tracert -d -h 15 $SERVER_PUBLIC_IP 2>&1
foreach ($line in $tracert) {
Log " $line"
}
# Check for CGNAT in traceroute
$cgnat = $tracert | Select-String "100\.(6[4-9]|[7-9]\d|1[01]\d|12[0-7])\."
if ($cgnat) {
Log ""
Log " [INFO] CGNAT detected in YOUR network path" "Yellow"
Log " This means your ISP uses Carrier-Grade NAT" "Yellow"
Log " This is on YOUR side and does not affect connecting to Weyflix" "Gray"
}
# ── 8. VPN / PROXY DETECTION ──
LogSection "8. VPN / PROXY CHECK"
$vpnAdapters = Get-NetAdapter | Where-Object {
$_.InterfaceDescription -match "VPN|TAP|TUN|WireGuard|Tailscale|Mullvad|Nord|Surfshark|Express|Proton" -and
$_.Status -eq "Up"
}
if ($vpnAdapters) {
Log " [INFO] VPN detected: $($vpnAdapters.InterfaceDescription -join ', ')" "Yellow"
Log " VPNs can sometimes block Plex connections" "Yellow"
Log " Try disconnecting your VPN and testing again" "Yellow"
} else {
Log " [OK] No VPN detected" "Green"
}
# Check proxy settings
$proxyEnabled = (Get-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -ErrorAction SilentlyContinue).ProxyEnable
if ($proxyEnabled) {
$proxyServer = (Get-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings").ProxyServer
Log " [INFO] System proxy enabled: $proxyServer" "Yellow"
Log " Proxies can interfere with Plex connections" "Yellow"
} else {
Log " [OK] No system proxy" "Green"
}
# ── 9. BANDWIDTH ESTIMATE ──
LogSection "9. BANDWIDTH ESTIMATE"
Log " Testing download speed..."
try {
$sw = [System.Diagnostics.Stopwatch]::StartNew()
$null = Invoke-WebRequest -Uri "http://${SERVER_PUBLIC_IP}:${PLEX_PORT}/identity" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop
$sw.Stop()
$responseTime = $sw.ElapsedMilliseconds
if ($responseTime -lt 500) {
Log " [OK] Fast response (${responseTime}ms) - streaming should work well" "Green"
} elseif ($responseTime -lt 2000) {
Log " [OK] Moderate response (${responseTime}ms) - streaming should work" "Green"
} else {
Log " [PROBLEM] Slow response (${responseTime}ms) - may have buffering issues" "Yellow"
}
} catch {
Log " Cannot estimate (server unreachable)" "Gray"
}
# ── 10. SUMMARY ──
LogSection "SUMMARY"
$issues = @()
if (-not $internetOK) { $issues += "No internet connection" }
if (-not $dnsOK) { $issues += "DNS resolution failing" }
if ($portTest -and -not $portTest.TcpTestSucceeded) { $issues += "Server port $PLEX_PORT is blocked/unreachable" }
if ($pingResults -and (10 - $pingResults.Count) -gt 2) { $issues += "Significant packet loss ($((10 - $pingResults.Count) * 10)%)" }
if ($pingResults -and ([math]::Round(($pingResults | Measure-Object -Property Latency -Average).Average, 1)) -gt 150) {
$issues += "High latency ($([math]::Round(($pingResults | Measure-Object -Property Latency -Average).Average, 1))ms)"
}
if ($vpnAdapters) { $issues += "VPN active (may interfere)" }
if ($proxyEnabled) { $issues += "System proxy enabled" }
if ($issues.Count -eq 0) {
Log ""
Log " [OK] No issues detected from your end!" "Green"
Log ""
Log " If you still can't connect, try:" "White"
Log " 1. Sign out of the Plex app and sign back in" "White"
Log " 2. Clear the Plex app cache" "White"
Log " 3. Make sure you're using the correct Plex account" "White"
Log " 4. Try a different device or network" "White"
} else {
Log ""
Log " Issues found ($($issues.Count)):" "Red"
foreach ($issue in $issues) {
Log " - $issue" "Yellow"
}
Log ""
Log " Some issues above may have suggested fixes you can try." "White"
Log " If you've fixed something, you can run this script again" "White"
Log " to verify the fix worked and check for any remaining issues." "White"
Log " (Your server IP is saved — just double-click the .bat again)" "Gray"
}
Log ""
Log "========================================================"
Log " WHAT TO DO NOW"
Log "========================================================"
Log ""
Log " ** PLEASE SEND THESE RESULTS BACK, even if you see fixes **"
Log " ** you can try. This helps the admin see the full picture. **"
Log ""
Log " The results are already copied to your clipboard!"
Log " Just Ctrl+V / paste into an email, text, or Discord message."
Log ""
Log " A file has also been saved to your Desktop:"
Log " $outputFile"
Log ""
Log " If you tried a fix and want to verify it worked:"
Log " Just double-click the .bat file again — your server IP"
Log " is saved so you won't need to re-enter it."
Log ""
Log "========================================================"
Log ""
Log " Weyflix is a free service provided with love to a"
Log " very fortunate group of people. That said, there are"
Log " real costs involved in keeping it running (hardware,"
Log " electricity, storage, internet, and time)."
Log ""
Log " Donations are never necessary but always appreciated:"
Log " Venmo: @weylin"
Log ""
Log " Thanks for being part of the Weyflix family!"
Log ""
# Copy results to clipboard
Get-Content $outputFile -Raw | Set-Clipboard
Write-Host ""
Write-Host "Results copied to your clipboard! Just Ctrl+V to paste anywhere." -ForegroundColor Green
Write-Host "Also opening in Notepad..." -ForegroundColor Cyan
Write-Host ""
Start-Process notepad.exe $outputFile
Read-Host "Press Enter to exit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment