如何显示绑定到端口的网页?

时间:2017-04-05 22:42:16

标签: port

我对端口没有很好的理解,所以我不确定如何解释这个。

我的网站上运行了一个应用,例如www.url.com:1234

我需要网址像www.url.com/class/subfoler/index.html

我该怎么做?感谢。

2 个答案:

答案 0 :(得分:0)

您需要使用域解析端口。

尝试:

http.createServer(function(request, response) {
  response.writeHead(200);
  request.on('readable', function () {
    var chunk = null;
    while( null !==(chunk = request.read())) {
      response.write(chunk);
    }
  });
  request.on('end', function() {
    response.end();
  });
}).listen(8080)

答案 1 :(得分:-2)

您可以尝试在index.html文件中使用iframe标记,该标记将在您的主(端口80)网站内提供您应用的(端口1234)网址,如下所示:

< iframe src =“http://www.url.com:1234”>如果您可以阅读此内容,则说明您的浏览器不支持iframe。< / iframe>

相关问题