Port Checker|端口连通性检测

端口连通性检测 | Port Checker

端口连通性检测 Port Checker

检查指定主机(域名/IP)的端口是否“可访问”。支持 HTTP/HTTPS 请求与 WebSocket 握手两种方式,并提供超时与诊断信息。
Check whether a host port is reachable using browser-friendly probes (HTTP/HTTPS fetch or WebSocket handshake), with timeout and diagnostics.

1. 输入参数 · Target & Probe Options
建议直接填写“纯主机名”:不包含协议(http://)与路径(/api)。
Prefer a bare host without scheme or path (no http://, no /api).
常见:80(HTTP)、443(HTTPS)、22(SSH)、3306(MySQL)、5432(PostgreSQL)、8443(自定义 HTTPS)。
Common ports: 80, 443, 22, 3306, 5432, 8443, etc.
Fetch:适合 Web 服务端口(80/443/8443)。可能遇到 CORS/证书问题。
WebSocket:适合 WS/WSS 服务或“握手可达性”测试。
Fetch is best for web ports; WebSocket checks handshake reachability.
路径:仅对 Fetch 生效;WebSocket 会忽略路径(多数场景握手在根路径即可)。
超时:网络较差时可调大(如 8000–15000ms)。
Path is used for fetch only. Increase timeout for slow networks.
3. 使用说明 · Notes
  • 这工具能做什么? · What this tool can do
    中文:在浏览器里,用 HTTP/HTTPS 请求WebSocket 握手 来判断目标端口是否“可访问/可建立连接”。适合快速排查:域名解析是否正确、端口是否被防火墙拦截、反代端口是否通、服务是否在监听。
    English:From the browser, it probes a target port via HTTP(S) fetch or WebSocket handshake to infer reachability. Useful for quick checks: DNS correctness, firewall blocks, reverse proxy exposure, or whether a web-ish service is listening.
  • 重要限制(必须读) · Critical limitations (please read)
    中文:浏览器安全模型限制:你无法直接进行“原生 TCP/UDP 端口扫描”。因此:
    ① 如果目标端口不是 HTTP/HTTPS/WS/WSS 服务,即使端口开放,也可能被判定为“不确定/失败”。
    ② Fetch 可能因 CORS证书重定向 被阻止 —— 这不等同于端口关闭。
    ③ WebSocket 的 error 事件也可能是协议不匹配,而非网络不可达。
    English:Browsers cannot perform raw TCP/UDP scans. So:
    ① If the port isn’t serving HTTP(S) or WS(S), an “open” port may still look “unknown/failed”.
    ② Fetch may be blocked by CORS, TLS cert issues, or redirects — not the same as “port closed”.
    ③ WebSocket errors can be caused by protocol mismatch, not only network failure.
  • 如何选择探测方式? · Which probe should I use?
    建议 · Recommendation:
    • 80/8080/8000 等 Web 端口:优先用 HTTP Fetch,路径可填 //health/healthz
    • 443/8443 等 HTTPS 端口:优先用 HTTPS Fetch,若是自签名证书,可能会失败(浏览器会拦截)。
    • WS/WSS 服务(如实时推送、网关):用 WS/WSS WebSocket 更贴近实际。
    English: Use HTTP(S) fetch for web ports; WS(S) for websocket services; be mindful of TLS and CORS.
  • 判定解读 · How to interpret the verdict
    可访问 · Reachable:握手/请求在超时内得到响应(即便是 404/401/403,也说明“能连上”)。
    不确定 · Inconclusive:通常是被 CORS/证书/协议不匹配影响,或网络环境特殊(代理、企业网、公共 Wi-Fi)。建议换方法或用命令行复检。
    不可达 · Unreachable:超时/网络错误更像“被拦截/未监听/路由不通”,但仍建议结合服务器侧日志与防火墙规则确认。
    English: A non-2xx HTTP status can still mean the port is reachable. “Inconclusive” often indicates browser policy rather than true outage.
  • 命令行复检(更可靠) · CLI re-check (more reliable)
    中文:如果你要做真正的 TCP 端口检测,请用服务器/本机命令行:
    nc -vz host port(Linux/macOS) / Test-NetConnection host -Port port(Windows PowerShell)
    • 需要跟踪路由:traceroute / tracert;需要 DNS:nslookup/dig
    English:For true TCP checks use nc / Test-NetConnection. Combine with traceroute and DNS tools for end-to-end diagnosis.
  • 安全提示 · Security note
    中文:请只测试你拥有权限的主机/端口。大规模扫描可能触发风控或法律风险。
    English:Only test hosts/ports you are authorized to check. Large-scale scanning may trigger abuse detection or legal issues.

说明:本工具在浏览器端运行,结果会受到网络环境、浏览器策略(CORS/TLS)、目标服务协议等因素影响;适合“快速可达性排查”,不等同于专业端口扫描器。
Note: This runs in the browser, so results are affected by network conditions, browser policies (CORS/TLS), and server protocol behavior. It’s great for quick reachability checks, but not a full port scanner.