2

I'm running a socket on my Mac laptop and when I telnet the IP address of my computer it says (IP is hidden for security reasons):

telnet 7-.---.--.--- 4005  
Trying 7-.---.--.---...  
telnet: connect to address 7-.---.--.---: Connection refused  
telnet: Unable to connect to remote host  

However when I do telnet on "localhost" it works it says (did not hide any info this is the raw message):

Trying ::1...  
telnet: connect to address ::1: Connection refused  
Trying fe80::1...  
telnet: connect to address fe80::1: Connection refused  
Trying 127.0.0.1...  
Connected to localhost.  

Update - Opened Firewall

Now after opening all of the ports localhost still works the same way as before however when I try the raw IP I get this new error:

Trying 7-.---.--.---...  
telnet: connect to address 7-.---.--.---: Operation timed out  
telnet: Unable to connect to remote host  
Akhil Reddy
  • 257
  • 7
  • 17

2 Answers2

1

The server is listening on the loopback interface only (INADDR_LOOPBACK), not all interfaces (INADDR_ANY) or a firewall is interfering with the connection.

trojanfoe
  • 120,358
  • 21
  • 212
  • 242
  • How should I fix this problem? I opened the ports on my router however it still doesn't work. – Akhil Reddy Jul 11 '11 at 23:36
  • If the server is listening on the loopback interface only there should be a command line option or configuration option to change that. – trojanfoe Jul 12 '11 at 06:30
0

Probably a firewall: generally localhost is not barred, but the external IP interface is.

Femi
  • 64,273
  • 8
  • 118
  • 148