Web前端之浏览器无法访问此网站、端口
Web前端之浏览器无法访问此网站、端口
·
MENU
问题
浏览器的坑,项目中前端端口设置为6000,结果无法访问。谷歌浏览器、火狐浏览器和IE浏览器都无法访问,开始以为是电脑防火墙的问题,但是一顿操作过后依然没有解决。
无法访问此网站 网址为http://192.168.141.171:6000/的网页可能暂时无法连接,或者它已永久性地移动到了新网址。 ERR_UNSAFE_PORT
解决
1、修改前端服务端口号
server: { host: '0.0.0.0', port: 8080, // 运行自动打开浏览器 open: true, proxy: { '/api': { // 本地 // target: 'http://localhost:6000/web/' changeOrigin: true } } },
2、允许浏览器的特殊端口号用作其他服务
找到谷歌浏览器的应用程序安装目录,桌面图标右键属性,设置允许端口参数。
在目标栏末尾处追加--explicitly-allowed-ports=port1,port2,port3
参数。
备注: 如果是有环境变量的程序,可以通过cmd命令窗口,执行where xxx
也可,例如where java
谷歌浏览器默认端口号
序号 | 端口号 | 描述 |
---|---|---|
01 | 1 | tcpmux |
02 | 7 | ech |
03 | 9 | discar |
04 | 11 | systa |
05 | 13 | daytim |
06 | 15 | netsta |
07 | 17 | qotd |
08 | 19 | chargen |
09 | 20 | ftp data |
10 | 21 | ftp access |
11 | 22 | ssh |
12 | 23 | telnet |
13 | 25 | smtp |
14 | 37 | time |
15 | 42 | name |
16 | 43 | nicname |
17 | 53 | domain |
18 | 77 | priv-rjs |
19 | 79 | finger |
20 | 87 | ttylink |
21 | 95 | supdup |
22 | 101 | hostriame |
23 | 102 | iso-tsap |
24 | 103 | gppitnp |
25 | 104 | acr-nema |
26 | 109 | pop2 |
27 | 110 | pop3 |
28 | 111 | sunrpc |
29 | 113 | auth |
30 | 115 | sftp |
31 | 117 | uucp-path |
32 | 119 | nntp |
33 | 123 | NTP |
34 | 135 | loc-srv/epmap |
35 | 139 | netbios |
36 | 143 | imap2 |
37 | 179 | BGP |
38 | 389 | ldap |
39 | 465 | smtp+ssl |
40 | 512 | print/exec |
41 | 513 | login |
42 | 514 | shell |
43 | 515 | printer |
44 | 526 | tempo |
45 | 530 | courier |
46 | 531 | chat |
47 | 532 | netnews |
48 | 540 | uucp |
49 | 556 | remotefs |
50 | 563 | nntp+ssl |
51 | 587 | stmp? |
52 | 601 | ?? |
53 | 636 | ldap+ssl |
54 | 993 | ldap+ssl |
55 | 995 | pop3+ssl |
56 | 2049 | nfs |
57 | 3659 | apple-sasl/PasswordServer |
58 | 4045 | lockd |
59 | 6000 | X11 |
60 | 6665 | Alternate IRC [Apple addition] |
61 | 6666 | Alternate IRC [Apple addition] |
62 | 6667 | Standard IRC [Apple addition] |
63 | 6668 | Alternate IRC [Apple addition] |
64 | 6669 | Alternate IRC [Apple addition] |
更多推荐
所有评论(0)