Python Forum
No connection could be made becouse the target machine actively refused it.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No connection could be made becouse the target machine actively refused it.
#1
I want to establish a connection between 2 diffrent mechies.

heres my code
server:
#!/usr/bin/python           # This is server.py file

import socket               # Import socket module

s = socket.socket()         # Create a socket object
host = socket.gethostname() # Get local machine name
port = 14321             # Reserve a port for your service.
s.bind((host, port))        # Bind to the port

s.listen(5)
while True:
   c, addr = s.accept()     # Establish connection with client.
   print ("Got connection from", addr)
   msg = input("what do you want to send?\n")
   c.send(msg)

client:

#!/usr/bin/python # This is client.py file 

import socket # Import socket module 
s = socket.socket() # Create a socket object 
host = socket.gethostname() # Get local machine name 
port = 14321 # Reserve a port for your service.
while True: 
    s.connect((host, port)) 
    print (s.recv(1024))
HEEEELP
it says No connection could be made becouse the target machine actively refused it.
what?
iv tryed a vpn btw... and it still desent work?
help?
Reply
#2
It may be looking for user agent, but there are many reasons why connection may be refused.
At any rate you can explore the guide here: https://www.w3.org/Protocols/rfc2616/rfc2616.html
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Machine actively refused it. External IP only ramboahoe 1 3,385 Mar-28-2020, 12:46 AM
Last Post: ramboahoe
  refused connection mcgrim 10 5,995 Nov-04-2019, 12:50 PM
Last Post: mcgrim
  Issue: Script from jumpserver to another server to target device? searching1 0 2,067 May-29-2019, 03:43 AM
Last Post: searching1
  Copy data from 1 blk device in machine A to another blk device in machine B AbhishekV 2 3,399 Feb-01-2018, 11:40 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020