I am trying to create a React / Node app.
Inside a React component I am trying to populate a component using:
await axios.get('//localhost:8081/')).data;
Node is running and netstat shows it is listening on 8081, additionally when I test using curl, the data is returned:
curl http://localhost:8081/
[{"id":1,"data":"test"}]
However in the browser console I see:
GET http://localhost:8081/ net::ERR_CONNECTION_REFUSED
Check if cors is enabled on server side. Additionally check if any other process is using the port, and node process/server is actually running.
"npm start" was running on port 3000, the server's firewall had this port open. node was running on 8081, this port was not open.
I thought the 3000 process (npm start) would talk to the 8081 process (node) directly, or something like that. But it looks like the 3000 server gives the page, then your browser talks directly to the 8081 process. Once I opened port 8081 on the firewall and changed the axios line with the server's IP it all worked.
I don't really understand why there are two processes for this.
Related
I am using vs code as a code editor for PHP. To view live time update I use vs code live server extension for chrome. Using Xampp(apache) for the PHP server. But suddenly I notice that some apps blocked my port 80 of windows 10 so I change the port for apache as 8080. Then my live server stopped working.
Can anyone tell me why this happened?
I want to add that if I change other ports like 8000 it works perfectly, what's wrong with 8080? is there any other limited ports for the liver server?
It's highly possible that vscode live server use port 8080 internally
When Xampp is set to another port than 8080 and live server is started, use the following command in cmd to display a list of process using that port:
netstat -an | find /i "8080"
The PID of the process using that port is at the end of the line , then do the next command by replacing with that number to find out which process opened it, you can also look in your task manager for that.
C:\ tasklist /svc /FI "PID eq <PID>"
Sorry for the basic question but im a complete noob on those matters.
I have a cloud server where i run a jup[yter notebook server, which normally is run on port 8888.
However when i try to connect to it from work, it doesnt work, which i suspect is due to the firewall.
I can connect from work to a regular ssh session through port 22 or 443.
However the jupyter notebook refuses to be run on those ports, probably because they are allocated already.
I tried to run PortQry to get the open ports on my work server (which is windows) and it reurned port 50248. I tried to have my jupyter server to listen on that one but it didnt work.
I also tried to scan the open port of my work server, but i received a warning from AWS! And the few ports that were returned as seemingly opened didnt work either when i set up my jupyter notebook to listen on them.
I would like to understand:
On my own server: How can i identify which port the jupyter server program can listen on?
On my work machine: How can i identify which one of my own server port would be let through the firewall of my work?
You need to use SSH local port forwarding.
https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding
You will open a SSH connection to your server but a local port, lets say 4444, will connect over the SSH connection and resolve to 8888 on the remote server.
With this you'd be able to open a browser locally and go to localhost:4444 and it would resolve to your remote hosted site. The command for this locally would be something like -
ssh -L 4444:localhost:8080 yourremoteserveraddress
An alternative option would be to use a SOCKS proxy via dynamic forwarding but this would involve needing to reconfigure your browser.
Always keep in mind any company policies around this type of thing. Even though 22 and 443 are open to the internet, use of them in this manner may break a policy and there is always the possibility of the company using a MITM proxy to monitor for this type of usage, specifically on 443.
Error received while starting the server
Reason:
Launching the server failed:
Location service deamon port 9000 is in use
Change each used port number to another unused port on the Ports page of
the server configuration editor.
I already tried to restart the computer and the result still the same.
What else i try to resolve this issue??
You have 2 options:
Stop the service/process which is using 9000 port or change its value
Change that 9000 port in WebSphere configuration. Since you cannot start your server you have to do it manually, editing xml config files:
I'm assuming you have standalone single server, in case deployment mananger and multiple servers you need to find the correct one.
Go to the PROFILE_ROOT\config\cells\YOUR_CELL_NAME\nodes\YOUR_NODE_NAME\serverindex.xml and look for 9000 it should be ORB_LISTENER_ADDRESS. Change that port to free one. You can check ports that are already taken in system using for example netstat -an
according to this doc
Does this mean we could port forward 8000 and 8443?
If I deploy a spring integration project with TCP port binding to 8000 or 8443, will I able to telnet to openshift?
I have tried, but not sure what happened. When I use putty RAW mode connect to 8443, and send some text, nothing happened on the server console, my program should print out what it received. so I suppose I failed, right?
P.S. that project was tested using localhost tomcat, it works locally.
this related question seems to successfully forwarding many port.
I wrote a simple WebServer using HttpListener class (.net 2.0)
It seems that It doesn't work on port other then 80.
When i sniff the transport to my server i can see the Syn packets on Port 8080 arrive to the server, but there is no Syn/Ack response, although when i sue netstat -a i can see that the server is listening to port 8080 (i verified that my application is the one that listens)
HttpListener server = new HttpListener()
server.Prefixes.Add("http://192.168.4.133:8080/");
server.Start();
_log.Write("Waiting for a connection... ");
HttpListenerContext context = server.GetContext();
HttpListenerRequest request = context.Request;
HttpListenerResponse response = context.Response;
_log.Write("Got request for " + request.RawUrl);
the above code doesn't receive any Context (stuck at the line server.GetContext())
if i change the Prefix to "http://192.168.4.133/"
the above code works perfectly.
when i am testing it on Port 80, i am killing the IIS services, and making sure that my application is the one that listen to the relevant port.
i am running this on XP, so i don't think it is security issues....but you never know..
i have read about the httpcfg tool, but didnt really understood it...
is there something inherntly diffrent between listening on port 80 to listening on other ports? 8080 or even better another random user port?
Thanks,
Itay
I'd suggest checking your firewall, and if you don't find anything -- try to run another server on 8080 and check if it's working (so you know that it's the port, not the server).
Check if you're firewall is on or off and if on, whether prohibiting this port access.
You can termorarily turn it of for the test just to make sure.
Side note: No need to be hunting down and killing IIS processes, simply stop the IIS windows service (run the command "services.msc" to see a list)