Thank you for your help.
I created a web server with node.js, but I can't access the web page. (I can't see it in my browser)
Filename server.js
var http=require('http');
var server = http.createServer();
server.on('request', function(req,res){
res.writeHead(200, {'Content-Type':'text/plain'});
res.write('hello world');
res.end();
});
server.listen(1337, '127.0.0.1');
console.log("server listening...");
Terminal View Results
[vagrant@localhostnodejs]$ node server.js
server listening...
I accessed it with localhost:1337, but the browser (chrome) says I cannot access this web page.
When I did as you advised, the following problem occurred.
[vagrant@localhostnodejs]$curl http://localhost:1337/
curl:(7) couldn't connect to host
It was written that it would be good to do the following to always set the proxy, so I tried it, but it seems that vi recognizes that writing is prohibited.
#vi/etc/bashrc
(I opened it with vi, so I added the following to the last line.)
alias curl="curl-x http://proxy.jpn.hp.com:8080/"
(: Save with wq and exit)
It looks like I'm going to use chmod to change the file, so please tell me how to write it to which file (bashrc?).
Thank you for your cooperation.
node.js
It seems to be running in a virtual environment, so it might be a network problem in that environment.
First, try accessing from the same environment as below.
node server.js&
curl http://localhost:1337/
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
911 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.