前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >项目部署到6666端口访问不了

项目部署到6666端口访问不了

作者头像
阿超
发布2022-08-21 13:59:24
2.1K0
发布2022-08-21 13:59:24
举报
文章被收录于专栏:快乐阿超快乐阿超

这个问题是由于chrome禁用了部分端口:

https://chromium.googlesource.com/chromium/src.git/+/refs/heads/master/net/base/port_util.cc

这里的:

代码语言:javascript
复制
// The general list of blocked ports. Will be blocked unless a specific
// protocol overrides it. (Ex: ftp can use port 21)
// When adding a port to the list, consider also adding it to kAllowablePorts,
// below.
const int kRestrictedPorts[] = {
    1,      // tcpmux
    7,      // echo
    9,      // discard
    11,     // systat
    13,     // daytime
    15,     // netstat
    17,     // qotd
    19,     // chargen
    20,     // ftp data
    21,     // ftp access
    22,     // ssh
    23,     // telnet
    25,     // smtp
    37,     // time
    42,     // name
    43,     // nicname
    53,     // domain
    69,     // tftp
    77,     // priv-rjs
    79,     // finger
    87,     // ttylink
    95,     // supdup
    101,    // hostriame
    102,    // iso-tsap
    103,    // gppitnp
    104,    // acr-nema
    109,    // pop2
    110,    // pop3
    111,    // sunrpc
    113,    // auth
    115,    // sftp
    117,    // uucp-path
    119,    // nntp
    123,    // NTP
    135,    // loc-srv /epmap
    137,    // netbios
    139,    // netbios
    143,    // imap2
    161,    // snmp
    179,    // BGP
    389,    // ldap
    427,    // SLP (Also used by Apple Filing Protocol)
    465,    // smtp+ssl
    512,    // print / exec
    513,    // login
    514,    // shell
    515,    // printer
    526,    // tempo
    530,    // courier
    531,    // chat
    532,    // netnews
    540,    // uucp
    548,    // AFP (Apple Filing Protocol)
    554,    // rtsp
    556,    // remotefs
    563,    // nntp+ssl
    587,    // smtp (rfc6409)
    601,    // syslog-conn (rfc3195)
    636,    // ldap+ssl
    989,    // ftps-data
    990,    // ftps
    993,    // ldap+ssl
    995,    // pop3+ssl
    1719,   // h323gatestat
    1720,   // h323hostcall
    1723,   // pptp
    2049,   // nfs
    3659,   // apple-sasl / PasswordServer
    4045,   // lockd
    5060,   // sip
    5061,   // sips
    6000,   // X11
    6566,   // sane-port
    6665,   // 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 + TLS
    10080,  // Amanda
};

端口都是用不了的

参考:https://jazzy.id.au/2012/08/23/why_does_chrome_consider_some_ports_unsafe.html

主要是防止黑客,例如smtp(25/465/587)端口,即便这些smtp服务被防火墙保护,但黑客也能通过smtp背后的浏览器,对服务端发送一封脚本邮件进行攻击

如果非要使用,可以按照这篇博客进行配置:

https://www.applenice.net/2019/06/04/ERR-UNSAFE-PORT-On-Browser/

那么,当使用6666端口的时候发生了什么,查了一下ERR_UNSAFE_PORT,出现该问题的原因主要是因为6666-6669这几个端口是IRC协议使用的缺省端口,存在很大的安全风险,出于安全考虑,Chrome、Firefox都禁止了对6666端口的访问。 那么如果一定要使用6666端口呢? 我使用的系统是Windows 10,使用Chrome版本为74.0.3729.169,方法如下: 复制 Google Chrome的图标->右键->属性->目标 在目标值后面追加: 复制 --explicitly-allowed-ports=6666 如果有多个值的话,用逗号隔开即可,关闭浏览器,重启启动,此时访问http://192.168.1.2:6666/ 就可以下载相应的文件了。 使用Firefox的话,可以通过如下方式解决: 在Firefox地址栏输入about:config,右键->新建一个字符串键network.security.ports.banned.override,值的内容填端口号6666,需要放行多个端口的话使用逗号隔开。 出于安全考虑,还是应该更换端口,不可能其他机器都如此设置,增大安全风险。 另外,Chrome认为有风险进行阻断的端口在Chromium源码中已经列出,使用时要注意规避: https://chromium.googlesource.com/chromium/src.git/+/refs/heads/master/net/base/port_util.cc

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-06-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档