Closed ReeseWang closed 1 month ago
Your build has completed!
[Preview deployment]()
HOSTNAME=127.0.0.1
是在 #1738 引入的,目的是解决proxychains代理本地地址的问题。首先我觉得proxychains不会使用HOSTNAME
这个环境变量,其次HOSTNAME
这个变量会被nodejs拿来作为监听地址,而监听127.0.0.1
会拒绝一切从外部来的连接。
编辑:我大概明白为什么有HOSTNAME=127.0.0.1
了,见#1556。nodejs想访问本机的时候用的是HOSTNAME
环境变量作为域名,被解析到了192.168.0.0/16,10.0.0.0/8,172.16.0.0/12和公网这样的地址上,然后proxychains会试图用代理服务器访问这些地址。
Bot detected the issue body's language is not English, translate it automatically.
HOSTNAME=127.0.0.1
was introduced in #1738 to solve the problem of proxychains proxying local addresses. First of all, I think proxychains will not use theHOSTNAME
environment variable. Secondly, theHOSTNAME
variable will be used by nodejs as the listening address, and listening on127.0.0.1
will reject all connections from the outside.
新观察到的行为:在HOSTNAME
和/etc/hostname
保持一致的情况下,如果用proxychains启动nodejs,nodejs会监听127.0.0.1:3000
,无法从外部访问。所以我前一个commit把HOSTNAME设置为0.0.0.0
是正确的。
proxychains太不科学了,彻底解决问题的方法是把它扔掉。
Bot detected the issue body's language is not English, translate it automatically.
Newly observed behavior: When
HOSTNAME
and/etc/hostname
are consistent, if nodejs is started with proxychains, nodejs will listen on127.0.0.1:3000
and cannot be accessed from the outside. So my previous commit set HOSTNAME to0.0.0.0
which is correct.
Proxychains is so unscientific that the only way to completely solve the problem is to throw it away.
Hi @ReeseWang would you mind check whether the latest commit works as expected, I just customized the nodejs listen address with --host
flag
@fred-bf Nope, still listening on 127.0.0.1
.
@ReeseWang is attempting to deploy a commit to the NextChat Team on Vercel.
A member of the Team first needs to authorize it.