Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/376.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 无法在本地计算机上的远程计算机上打开HTML文件_Javascript_Html_Node.js_D3.js_Client Server - Fatal编程技术网

Javascript 无法在本地计算机上的远程计算机上打开HTML文件

Javascript 无法在本地计算机上的远程计算机上打开HTML文件,javascript,html,node.js,d3.js,client-server,Javascript,Html,Node.js,D3.js,Client Server,我有一个虚拟机(ubuntu 16.04),我通过putty使用它。 我有一个服务器文件夹和我的服务器脚本learning_server.js,看起来像(节点结节就是文件夹) ` 我有一个html文件夹和html(learning_index.html)文件 现在我正在尝试使用本地windows机器打开learning_index.html文件 `http://10.158.56.133:5000/D3js/client/html/learning_index.html` but it show

我有一个虚拟机(ubuntu 16.04),我通过putty使用它。 我有一个服务器文件夹和我的服务器脚本learning_server.js,看起来像(节点结节就是文件夹) `

我有一个html文件夹和html(learning_index.html)文件

现在我正在尝试使用本地windows机器打开learning_index.html文件

`http://10.158.56.133:5000/D3js/client/html/learning_index.html`
but it shows 
`This site can’t be reached 10.158.56.133 took too long to respond.
Search Google for 158 133 5000 D3js client html learning index
ERR_CONNECTION_TIMED_OUT`

你能告诉我我做错了什么吗?

我的第一个猜测是,你的Ubuntu虚拟机上的防火墙正在阻止端口5000

默认情况下,您应该在ubuntu机器上安装一个名为“简单防火墙(UFW)”的工具

运行以下命令应允许远程计算机连接到该端口:

sudo ufw allow 5000

运行该命令后,您可以从浏览器中重试,以查看是否可以访问该页面。

您有什么类型的虚拟机?我不确定这是什么意思。是vmware还是virtual box?你试过更改网络接口设置吗?我试过了,但似乎不起作用。此外,我不确定我是否正确执行或调用了页面
http://10.158.56.133:5000/D3js/client/html/learning_index.html
**请注意,当我试图打开HTML文件时,我使用命令提示符对这台机器进行了ssh,并且它已连接
`<!doctype html>
<html>
<head>
    <title>Simple Client Demo (NodeJS)</title>
    <meta charset="utf-8">
    <link href="/home/ricky/D3js/css/style.css" rel="stylesheet" media="screen" type="text/css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="http://d3js.org/d3.v5.min.js" charset="utf-8"></script>
</head>

<body>
    <div class="MainVis">
        <svg width="1080" height="200"></svg>
    </div>
    <div class="update">
        <input name="updateButton" 
           type="button" 
           value="UPDATE" 
           onclick="updateData('updated_data_request')" />
        <input name="deleteButton" 
           type="button" 
           value="DELETE" 
           onclick="updateData('deleted_data_request')" />
    </div>
    <script type="text/javascript" src="./js/learning_client.js"></script>
</body>
</html>
`
`NodeJS Server - 2019 March
No of rows read:  91
Server IP is 10.158.56.133 port 5000
Server is Ready...
`
`http://10.158.56.133:5000/D3js/client/html/learning_index.html`
but it shows 
`This site can’t be reached 10.158.56.133 took too long to respond.
Search Google for 158 133 5000 D3js client html learning index
ERR_CONNECTION_TIMED_OUT`
sudo ufw allow 5000