Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I thought a web server process I brought up was listening on localhost:8080, and tried to connect to it, but kept getting connection reset errors. As it turns out, I was mistaken and my process was listening on a totally different port.

What I can't understand, however, is why I was getting the connection reset errors, rather that "connection refused" that you'd normally get if no process was listening on that port. There isn't anything else listening on 8080 as far as I can tell:

$ sudo lsof -i -P  | grep 8080
# no result
$ sudo netstat -a -n  | grep 8080
# still no result

Yet connections to this port are initially accepted (although closed on further data):

$ /usr/local/bin/wget localhost:8080
--2014-01-14 16:29:22--  http://localhost:8080/
Resolving localhost... ::1, 127.0.0.1, fe80::1
Connecting to localhost|::1|:8080... failed: Connection refused.
Connecting to localhost|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... No data received.

Similarly with telnet:

$ telnet localhost 8080
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

Trying other random ports just results in the expected connection refused error:

$ telnet localhost 8081
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Trying fe80::1...
telnet: connect to address fe80::1: Connection refused
telnet: Unable to connect to remote host

My hosts file is bare bones:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost 
fe80::1%lo0     localhost
share|improve this question
    
it's possible you have a service installed that is managed via launchd, with launchd reserving any ports. See my answer here (though the lsof seems to be wrong). Some documentation on this behavior is in man launchd.plist when searching for socket. –  Daniel Beck Jan 15 at 2:02
    
OK, this seems plausible, but grepping through everything in /Library/Launch*/*.plist and /System/Library/Launch*/*.plist doesn't turn up any hits for http-alt or 8080. Any way I can list what ports launchd is listening on? Google came up empty (for me, anyway). –  BeeOnRope Jan 15 at 7:22

1 Answer 1

up vote 3 down vote accepted

Not sure why a comment was deleted, but the issue was the Cisco AnyConnect Secure Mobile Client.

Another thread that had this answer. Looks like it is an issue with the Cisco AnyConnect Secure Mobile Client.

share|improve this answer
    
The evidence is pretty compelling, especially given that I do have ANyConnect installed. Too mad there doesn't seem to be any reason cisco is listening on that port... –  BeeOnRope Jan 17 at 9:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.