LightAtom

ERR_UNSAFE_PORT: Why Chrome Blocks Some Ports

Chrome blocks HTTP requests to a list of ports used by other protocols (mail, SSH, X11, IRC and more) to prevent cross-protocol attacks.

ERR_UNSAFE_PORT

The address uses a port Chrome won't send web requests to, because that port belongs to another kind of service and could be abused.

Quick checks

  • Is it your own development server? Move it to another port (3000, 5173, 8000, 8080).
  • Check the port in the address is the one you meant.

Fixes on Mac

  1. Use a different port

    1. Restart your server on an allowed port, for example npm run dev -- --port 5173.
  2. Allow the port for testing only

    1. Launch Chrome from Terminal: open -a "Google Chrome" --args --explicitly-allowed-ports=6000.
    2. Use this only for local testing.

Fixes on Windows

  1. Same options

    1. Change the port, or start Chrome with --explicitly-allowed-ports=PORT for testing.

Other devices

  1. Other browsers

    1. Firefox and Safari block similar port lists, so changing the port is the reliable fix.

Still not working?

Blocked ports include those for FTP, SSH, SMTP and other mail (25, 110, 143, 587, 993…), NFS (2049), SIP (5060), X11 (6000), IRC (6665–6669) and 10080. The list follows the WHATWG Fetch standard's “bad ports”.

See what’s happening

LightAtom's Ports view shows which port your local server listens on, so you can spot one that browsers block.

Frequently asked questions

Why does Chrome block port 6000?

6000 is the X11 display server's port. Letting web pages send requests there could be used to attack local services, so browsers block it.

Which ports does Chrome block?

The “bad ports” in the Fetch standard: dozens of service ports such as 25, 110, 143, 2049, 5060, 6000, 6665–6669 and 10080.

Can I unblock a port permanently?

Only with the --explicitly-allowed-ports flag each time Chrome starts, or with an enterprise policy. Changing the port is simpler.

LightAtom team

The people who build LightAtom, a network monitor for macOS.