<# Verify-HonorProPlugins.ps1 ------------------------------------------------------------------------- Checks that each HonorPro plugin answers on its loopback RPC port with the token set by the installer. Run on the MT5 server after enabling the plugins and restarting the server component. .\Verify-HonorProPlugins.ps1 #> [CmdletBinding()] param( [int] $BridgePort = 8091, [int] $CopyPort = 8092, [int] $PtlPort = 8093, [switch] $NoPtl ) function Get-MachineEnv([string]$k) { [Environment]::GetEnvironmentVariable($k, "Machine") } function Test-Plugin([string]$name, [int]$port, [string]$token) { Write-Host ("-- {0} (127.0.0.1:{1})" -f $name, $port) if (-not $token) { Write-Host " no token in env - did the installer run?" -ForegroundColor Yellow; return } try { $r = Invoke-RestMethod -Method Post -Uri "http://127.0.0.1:$port/rpc" ` -Headers @{ Authorization = "Bearer $token" } ` -ContentType "application/json" -Body '{"op":"status"}' -TimeoutSec 10 if ($r.ok) { Write-Host " OK - status answered" -ForegroundColor Green } else { Write-Host " reachable but replied: $($r | ConvertTo-Json -Compress)" -ForegroundColor Yellow } } catch { Write-Host " FAILED: $($_.Exception.Message)" -ForegroundColor Red Write-Host " (plugin not loaded, wrong port, or MT5 server not restarted since install)" } } Write-Host "== HonorPro plugin verification ==" -ForegroundColor Cyan Test-Plugin "Bridge" $BridgePort (Get-MachineEnv "BRIDGE_TOKEN") Test-Plugin "Copy-Trading" $CopyPort (Get-MachineEnv "COPY_TOKEN") if (-not $NoPtl) { Test-Plugin "Pick The Level" $PtlPort (Get-MachineEnv "PTL_TOKEN") } Write-Host "" Write-Host "A green 'status answered' on each means the plugin is live on loopback." Write-Host "HonorPro reaches these same ports through the SSH tunnel - nothing is opened to the network."