How to run Node.js from my computer
I want to show a friend something I wrote in Node.js. In order to do so I must run a local machine but I can't get it to work out of 127.0.0.1.
I am trying to run: server.listen(8000, '123.123.123.123');
(with my real IP of course) and I get "Error: listen EADDRNOTAVAIL".
It does work via 127.0.0.1:8000 when I execute: server.listen(8000);
.
When I try to a开发者_开发技巧ccess 123.123.123.123:8000 after doing that firefox is "unable to connect".
Any ideas?
One simple solution is to use a port forwarding tool. Here are three:
- proxylocal is free and open source.
- showoff.io has a nice design and really cheap day passes.
- pagekite bills based on data usage and has a generous trial.
To make your above example work with showoff.io, you would need to have a ruby environment and a showoff.io account and type:
> gem install showoff-io
> show 8000
share this URL:
https://youraccountname.showoff.io
(It would ask for your password after typing show 8000
.)
Then your friend could visit the URL showoff gives you.
精彩评论