部署了個測試靜態頁,用了10080端口。curl訪問沒問題,chrome瀏覽器訪問報錯
ERR_UNSAFF_PORT
查了一下,google對于部分端口在客戶端是直接攔截的。請求都不會到服務器
定義在這里
谷歌官網源碼:chromium.googlesource.com
github項目源碼:chromium/net/base/port_util.cc at main · chromium/chromium · GitHub
這個10080端口原來是不在攔截列表里的,是后來加的,真坑啊。
最新的如下
const int kRestrictedPorts[] = {1, // tcpmux7, // echo9, // discard11, // systat13, // daytime15, // netstat17, // qotd19, // chargen20, // ftp data21, // ftp access22, // ssh23, // telnet25, // smtp37, // time42, // name43, // nicname53, // domain69, // tftp77, // priv-rjs79, // finger87, // ttylink95, // supdup101, // hostriame102, // iso-tsap103, // gppitnp104, // acr-nema109, // pop2110, // pop3111, // sunrpc113, // auth115, // sftp117, // uucp-path119, // nntp123, // NTP135, // loc-srv /epmap137, // netbios139, // netbios143, // imap2161, // snmp179, // BGP389, // ldap427, // SLP (Also used by Apple Filing Protocol)465, // smtp+ssl512, // print / exec513, // login514, // shell515, // printer526, // tempo530, // courier531, // chat532, // netnews540, // uucp548, // AFP (Apple Filing Protocol)554, // rtsp556, // remotefs563, // nntp+ssl587, // smtp (rfc6409)601, // syslog-conn (rfc3195)636, // ldap+ssl989, // ftps-data990, // ftps993, // ldap+ssl995, // pop3+ssl1719, // h323gatestat1720, // h323hostcall1723, // pptp2049, // nfs3659, // apple-sasl / PasswordServer4045, // lockd5060, // sip5061, // sips6000, // X116566, // sane-port6665, // Alternate IRC [Apple addition]6666, // Alternate IRC [Apple addition]6667, // Standard IRC [Apple addition]6668, // Alternate IRC [Apple addition]6669, // Alternate IRC [Apple addition]6697, // IRC + TLS10080, // Amanda
};