const http = require('http');
http.createServer(function (req, res) {
res.end('port : 9999');
}).listen(9999, '0.0.0.0');注意 www.a.me 和 www.b.me 这两个域名需加入 C:WindowsSystem32driversetchosts 文件中。
127.0.0.1 www.a.me
127.0.0.1 www.b.me
当我们访问 www.a.me 或 www.b.me 时,就会自动帮我们代理到指定端口的服务上去。
希望本文所述对大家node.js程序设计有所帮助。









