this is the first time I use nodejs (and express), so I'm sorry if the question is stupid.
I installed nodejs and express on my debin virtual machine and created hello-world application. I run it like
DEBUG=myapp ./bin/www
Calling my application from virtual machine works just fine, but it ignores requests from outside workspace (windows). I thought it could be related to apache that I also have, so I stopped it, but it doesn't solve the issue. Please advice.
Thanks.
And this is how I solved it.
Opened port 3000 in Firewall (not sure if this was required), see how to do this http://windows.microsoft.com/en-us/windows/open-port-windows-firewall
Added port forwarding in my vm settings in virtualbox. By default there were ports 80 and 22. So I added 3000 which was the solution.
Related
I have a nodejs application that i wanted to deploy on a local server(which is running Fedora 36). I have developed the NodeJS side on another pc,and it works fine when the node is running. But when i copy the node server directory to the fedora serve and run it,it only works on local host. I couldnot access the server even if i'm in the same network.
I'm developing the app for a small locally connected PC and i donot want to use the hosting companies as well as Heroku. Is the it the firewall that is blocking my request to the server? What option do i have to host it locally? Is there a better way?
Your node.js server is running on a port determined at the end of the script usually. Sometimes 3000. but can be anything. The correct way for others to access is as you say...
http://your.network.ip.address:port/
or
example ip
http://192.168.0.3:3000
check your local ip and port where you run this server.
How could others, on a local network, access my NodeJS app while it's running on my machine?
Intro:
I have an app, when I run it, it connects to a server and shares its bandwidth, (basically gives out the public IP for the server to use),
Development:
Now I wanted that app to use transparent socks5 proxy for sending and receiving requests. This was possible when I downloaded the app (non containerized version) on ubuntu and configured red-socks and iptables in it, the server the app connected to assumed the app's public IP was the one I mentioned (socks5://user:pass#ip:port) (i own these proxy IPs too)
Requirement:
Next, I wanted to scale it out, so I looked for a docker image of this app, it was available so I downloaded and ran it, it worked fine, but the IP the server received was the non proxy IP (obviously as I have not configured any proxy).
My proposed idea was to run multiple docker containers,
but I still don't know how will I configure a different socks5 proxy for each of these containers.
Can someone advise me on how to go forward with this.
Thank you in advance :D
Edits: I had mentioned I was trying to do what I did with the ubuntu system on a ubuntu docker container, removed that and organized the whole situation.
This has been a very difficult thing to investigate as well as configure, everyone oneline just have half documentation, for some reasons everyone is concentrated on the running of nodejs on the commandline, or if not, they want to run it on http://localhost:8080.
What I need is a full documentation from installation, configuration, vhost setup, to running a nodejs website such as http://node.local/ website on my work machine.
Please assist, I have been googling for 3 days on this, have not found anything, I need to setup http://node.local website fully running nodejs.
Use proxy http server. For example nginx is pretty easy to configure.
And it will proxy requests from port 80 to port 3000, for example.
Here you can find quick guide to setup one.
A little bit of context. I have developped a webapp on node.js (and a glamourous set of extensions). It has been approved for testing with true users at my company and i am supposed to deploy it now. Problem is that basically i have no idea unto how attack this problem. I have so many questions.
For the moment i have created a virtual machine on the local server. I have installed ubuntu server unto it and i have the intuition about how to deploy the app in this part (i suppose following the same steps as when i started to work on this project). I do not know however if i can have remote access from the outside of my network to this virtual machine. I also dont know if additional configuration in ubuntu's side is needed to make such an idea work (for example: in the installation there was a part about proxies that at the moment i decided to ignore)
From the few documents i have read about it since i was assigned this, a solution may lie in using nginx. The logic behind it if i am not mistaken (and please correct me if i am) is that nginx can help linking the HTTP requests (through the port 80 which is normally opened for access in most machines) and link it to a specific port on the machine (The sexy app i have developped).
In a more early stage, what ressources would i need to start this off? Would i need a domain name? IS it necessary? Do i need a different virtual server to link the apps or can they be on the same machine?
If you have additional comments or tips for someone that is learning to do this kind of thing, please do.
For remote access, you will need a couple of things. First of all, you will need to make sure that your virtual machine is on a bridged adapter. I'm not sure what virtual machine you are on, or I'd give you more detail on how to do this. Second, you will need to make sure that your router has port 80 (or whatever port you chose to use) setup via port forwarding so that requests coming in map to the server (a request comes to the router on the port, the router must then know where to send those requests to). Finally, if you want to use a port other than port 80, you should be able to configure this in the nodejs configuration. This may also be configurable in the router so that requests coming in on port 80 are mapped to, say 8080, but, given that this is a company, it's probably easier to reconfigure the nodejs server than have it set up special mapping.
This experience comes from personal experience with hosting web servers at home. Corporate routers should need similar configuration unless each system has a public IP address on the internet, which is unlikely.
We have some computers connected through LAN. I have a node process running locally on the port 5000.
I wanna direct the requests "andy.dev" to my node process .
It should be the same when accessed from all computers.
I'm on windows7. I have nginx installed.
I have only a conf folder, NO sites available or anyother like the old configuration for nginx. So I'll be happy if you explain me how to configure nginx(newer version) to do this or directly through nodejs.
I have been reading about virtual host in google but really dont understand how to set it up.
NOTE: I dont have admin rights.
Any help will be greatly appreciated! Thanks.