No connection could be made because the target machine actively refused it nginx
No connection could be made because the target machine actively refused it nginx
«No connection could be made because the target machine actively refused it.» from external client
When I run server.php / client.php on the same machine ( localhost ), it works fine. Also, when I run server.php on the server, and client.php on the same server but from other local PC (i.e. local_server_ip / client.php ), all works fine as well.
However, when I run server.php on the server and client.php on the other PC on the same network (replacing localhost with local_server_ip_addr in the client.php script), it fails with the actively refused connection error.
All necessary ports are forwarded in the router. I guess it is kind of security block on XAMPP/Linux and can be eliminated by some configuration file. I replaced Deny from all in the New XAMPP security concept with Allow from all in httpd-xamp.conf file, but it still fails.
Any help would be much appreciated.
(PS: server/client scripts examples taken from http://i-novice.net/sokety-v-php/ )
UPD: Have modified port 8080 (the one is dedicated for sockets in my system) to XXXXX. All works fine!
1 Answer 1
In the event that this happens dependably, it actually implies that the machine exists however that it has no administrations listening on the predetermined port, or there is a firewall ceasing you.
In the event that you composed the server, you may have substantial preparing in the acknowledge of your attachment, and this can be better moved to a different specialist string so your acknowledge is constantly prepared to get associations. There are different structural engineering decisions you can investigate that alleviate lining up customers and handling them successively.
There is an uncommon probability where a NAT switch would give this blunder if its ports for mappings be depleted. I think we can toss this probability as a lot of a long shot however, since the switch has 64K concurrent associations with the same destination location/port before weariness.
No connection could be made because the target machine actively refused it
I’m trying to do a web request from a webpage and I’m having problem on production server.
The web application is a intranet web site with this configuration on web.config:
I use it to get the domain user authentication.
Now I’m trying to load a web page to parse some information, I used the code below, the error appears on the second line:
The error message is:
No connection could be made because the target machine actively refused it 64.233.163.104:80.
Stack Trace:
This error don’t occur with all URLs that I have tryed, I can get the response from www.yahoo.com but not from www.google.com for example.
On my PC (Windows 7) everything allways works, I can get response from any URL using the same authentication mode (with domain controller), the problem only occur on the production server (Windows Server 2008).
Anyone has a ideia?
2 Answers 2
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
I had a problem like this, it turned out that we are behind a proxy, that could be the issue, I know its a long shot, but it just might work
I copied the proxy data from my browser, just replace the proxy string with your proxy (don’t forget the port).
Not the answer you’re looking for? Browse other questions tagged asp.net or ask your own question.
Linked
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
No connection could be made because the target machine actively refused it
Can any help me to resolve it?
10 Answers 10
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
Okay, so i tried all of the answers and none of them worked. If you are using different port than 3306 for MySQL you need to specify it in config.inc.php.
So since i was using port 3308, my solution was adding the following line in config.inc.php:
add it right bellow the user, password or extension lines.
Delete all the files.It will work.
open the file config.inc.php Go to line no:31
Change the line to :
Restart your system.
If your operating system is Windows 7:
If your operating system is Linux (Ubuntu):
Please go to c:\xampp\tmp folder and delete all the files. It works for me may help you.
Please try changing connect_type in your config.inc.php from ‘tcp’ to ‘http’. This file exists in the phpMyAdmin top level directory.
Existing line looks like this:
New line should be looking like this:
Assuming you’re trying to connect to http://localhost/phpmyadmin.
From XAMPP control panel start both the Apache module and the MySQL module.
Sometimes if you delete your temporary files in windows in
Check if your MySql service is running or not.
You can check it by searching Services in Start and then check the status of mysql80 service. If your service is not running then start service by right clicking on it and then Start.
Or you can use CMD.
I have a problem with these client and server codes, I keep getting the [Errno 10061] No connection could be made because the target machine actively refused it
I’m running the server on a virtual machine with Windows XP SP3 and the client on Windows 7 64bit, my python version is 2.7.3. What I want to know is how should I edit the code to use the client and server on different networks! Thanks!
server :
client :
PS : code is from internet.
17 Answers 17
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
10061 is WSAECONNREFUSED, ‘connection refused’, which means there was nothing listening at the IP:port you tried to connect to.
There was a firewall product around the year 2000 that issued refusals instead of ignoring incoming connections to blocked ports, but this was quickly recognised as an information leak to attackers and corrected or withdrawn.
Hint: actively refused sounds like somewhat deeper technical trouble, but.
. actually, this response (and also specifically errno:10061 ) is also given, if one calls the bin/mongo executable and the mongodb service is simply not running on the target machine. This even applies to local machine instances (all happening on localhost).
➪ Always rule out for this trivial possibility first, i.e. simply by using the command line client to access your db.
So I was facing the same issue, and the solution that worked for me was.
I am assuming your server and client program are written in python.
There is no relationship between error and firewall.
first, run server program,
then run client program in another shell of python
and it will work
host = ‘192.168.12.12’ port = 12345
use this host address when binding and connecting to the socket.
server.bind((host, port)) client.connect((host, port))
this change solved the issue for me.
The solution is to use the same IP and Port number in both client and server. Try, in client to use TCP_IP = ‘write the ip number here’ TCP_PORT = writ the port number here s.connect((TCP_IP, TCP_PORT))
I was facing a similar problem when I was calling REST API using python library and what I found that my server was going into sleep mode which was leading to this. As soon as I logged in to the server via Remote Desktop Connection, my API call used to work.
This could be because of proxy or firewall. If it’s proxy, then you need to specify proxy setting at entry point of your code or project.
The below changes fixed my problem. I struggled with the same error for a week. I would like to share with you all that the solution is simply host = » in the server and the client host = ip of the server.
The first: Please make sure your port ‘12345’ is opening and then when you using a different network. You have to use the IP address in LAN. Don’t use the ‘localhost’ or ‘127.0.0.1’. The solution here is: In server
In client
Hope it works for you
I had errors 10060 and 10061. The reason was in my antivirus(Eset Nod 32). Try to turn off the Firewall of your antivirus as I did or just delete it for a time to test the program. If everything started to work properly, add that program to the exclusion or switch to another antivirus. Also, try to change the ‘host’ variable to an empty string:
And add socket.AF_INET, socket.SOCK_STREAM to the ‘s’ variable:
I was doing this tutorial and they said that windows users will have a problem. They said that you can check the Windows Firewall to fix the problem. Let me show you a quick Google Search on how to change the windows firewall:
This change worked for me with my Client on Windows and Server on Ubuntu VM.
the short term solution is to use the default iis host and port normally 120.0.0.1 and 80 respectively. However am still looking for a more versatile solution.
No connection could be made because the target machine actively refused it. (10061) #1319
Comments
codeagencybe commented Apr 25, 2020
Environment
Describe the bug
cannot connect to 192.168.0.116:5555: No connection could be made because the target machine actively refused it. (10061)
Any idea why and how to fix this?
I’m just using a stock Samsung phone with Android. Nothing else happened with this device for years. But I can’t connect to it.
Yes, both devices are in the same wireless network
The text was updated successfully, but these errors were encountered:
rom1v commented Apr 25, 2020
codeagencybe commented Apr 25, 2020
Yes I did that but then it says it could not find any devices or emulators
But meantime I have rebooted my entire device and start again and weird enough that error is gone.
But now nothing is showing on my computer.
The command seems to be working/running but I’m not sure what is expected after that.
This is all I get:
rom1v commented Apr 25, 2020
Does it work over usb?
codeagencybe commented Apr 25, 2020
It’s the same when trying over USB.
It just freezes the command line after I run any of the adb or scrcpy commands.
What should happen after this? Does it open some popup?
Do I need to use some other software to see something?
It’s not documented anything process happens after you run any of those commands so I can’t judge or troubleshoot properly if the outcome is correct or not.
rom1v commented Apr 25, 2020
It should immediately open a window showing your Android device.
Check the output of adb logcat (in a separate terminal) when you start scrcpy.
codeagencybe commented Apr 25, 2020
nothing happens. Even that log command just freezes.
I alrready tried adb disconnect, kill server etc. they all freeze the command line
rom1v commented Apr 25, 2020
Oh ok you must solve that adb issue then.
Reboot your device and try again over USB.
codeagencybe commented Apr 25, 2020
ok I’ll give that a try later today and report back if it worked
howzhal commented Jun 16, 2020
Hi i have this issue as well. Connection with cable works fine but not for the wireless. I did adb tcpip 5555 then connecting it with adb connect myip:5555 and disconnect the device. When i start the scrpcy it doesnt detect my device, then i opened up the cmd to check if the connection is still establish it didnt. Please help 🙂
r4zi3lrrr commented Jun 23, 2020
My phone is able to connect via scrcpy over usb cable on a Windows 10 machine and also on wi-fi when I run the initial commands:
adb.exe tcpip 5555
adb.exe connect 192.168.1.147:5555
Is this by design?
I’ve added screenshot of what I get when the phone is connected.
rom1v commented Jun 23, 2020
It’s how adb works. However, if you just reboot your computer (not your device), you should be able to adb connect without plugging USB again.
r4zi3lrrr commented Jun 24, 2020
pmavery commented Feb 5, 2021
After also struggling thru the same phone/pc/controller connection problem as above, I was finally able to make the connection work & successfully build & run an Android app (DJI «sample_code» from GitHub). The steps listed below worked for me.
Источники информации:
- http://stackoverflow.com/questions/4001103/no-connection-could-be-made-because-the-target-machine-actively-refused-it
- http://stackoverflow.com/questions/16712581/no-connection-could-be-made-because-the-target-machine-actively-refused-it
- http://stackoverflow.com/questions/12993276/errno-10061-no-connection-could-be-made-because-the-target-machine-actively-re
- http://github.com/Genymobile/scrcpy/issues/1319