节点http-server即使在它们关闭后也会保留端口8080

时间:2021-05-29 18:11:01

First, this is my configuration:

首先,这是我的配置:

Windows 7 Professional
Node v0.12.2
NPM v2.7.4
http-server v0.8.0

Windows 7专业节点v0.12.2 NPM v2.7.4 http-server v0.8.0

I've installed http-server using npm install http-server -g, still on terminal, gone to my root folder ...\node\teste and executed http-server -a127.0.0.1 -p8080. Until this part everything seemed ok. The server was up and running.

我已经使用npm install http-server -g安装了http-server,仍然在终端上,转到我的根文件夹... \ node \ teste并执行了http-server -a127.0.0.1 -p8080。直到这一部分,一切似乎都好。服务器已启动并正在运行。

When I accessed the url localhost:8080, it gave me a download file back as an answer, my index.js.

当我访问url localhost:8080时,它给了我一个下载文件作为答案,我的index.js。

Shutdown the server with CTRL+C at the terminal, made some changes in file, up the server again and a download file as response again, but not the actual file it was the first one I've downloaded and deleted.

在终端上用CTRL + C关闭服务器,在文件中进行一些更改,再次向上运行服务器并再次作为响应下载文件,但不是实际文件,这是我下载和删除的第一个文件。

So, I've changed my original file name, stopped the http-server function, cleared the ports so that was not shown in netstat -a -b and I can still access localhost:8080 and download the file. Even restarting my PC.

所以,我已经更改了我的原始文件名,停止了http-server功能,清除了端口,因此没有显示在netstat -a -b中,我仍然可以访问localhost:8080并下载该文件。甚至重新启动我的电脑。

There is no node process running, I've checked.

没有节点进程在运行,我已经检查过了。

1 个解决方案

#1


2  

After all that effort, which can be considered part of the sollution, I finally found what as the last piece of the puzzle.

经过所有努力,这可以被认为是解决方案的一部分,我终于找到了最后一块拼图。

I've gone to my broswer(Google Chrome) and oppened:
Settings > Advanced Settings > Privacity > Clear Data

我已经去了我的broswer(谷歌浏览器)并选择了:设置>高级设置>权限>清除数据

And cleared all my broser data.

并清除了我所有更加粗鲁的数据。

Then localhost:8080 is free now.

然后localhost:8080现在免费。

Wanted to share this information so nobody will lost hours, like me, trying to find answers.

想要分享这些信息,所以没有人会像我一样浪费时间,试图寻找答案。

#1


2  

After all that effort, which can be considered part of the sollution, I finally found what as the last piece of the puzzle.

经过所有努力,这可以被认为是解决方案的一部分,我终于找到了最后一块拼图。

I've gone to my broswer(Google Chrome) and oppened:
Settings > Advanced Settings > Privacity > Clear Data

我已经去了我的broswer(谷歌浏览器)并选择了:设置>高级设置>权限>清除数据

And cleared all my broser data.

并清除了我所有更加粗鲁的数据。

Then localhost:8080 is free now.

然后localhost:8080现在免费。

Wanted to share this information so nobody will lost hours, like me, trying to find answers.

想要分享这些信息,所以没有人会像我一样浪费时间,试图寻找答案。