puma-dev: OSX High Sierra: can't listen on port 80
I’m not sure what I’m doing wrong but puma-dev works fine on any port except for port 80:
This works as expected:
sudo puma-dev -dir /Users/me/.puma-dev --http-port 81 --https-port 443 -d dev:test:localhost
This does not:
$ sudo puma-dev -dir /Users/me/.puma-dev --http-port 80 --https-port 443 -d dev:test:localhost
* Directory for apps: /Users/me/.puma-dev
* Domains: dev, test, localhost
* DNS Server port: 9253
* HTTP Server port: 80
* HTTPS Server port: 443
! Puma dev listening on http and https
^C! Shutdown requested
I get “connection refused”:
curl -vH "Host: puma-dev" localhost/events
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connection failed
* connect to 127.0.0.1 port 80 failed: Connection refused
* Trying ::1...
* TCP_NODELAY set
* Connection failed
* connect to ::1 port 80 failed: Connection refused
* Failed to connect to localhost port 80: Connection refused
* Closing connection 0
curl: (7) Failed to connect to localhost port 80: Connection refused
lsof
tells me nothing is listening on port 80 except for puma-dev
:
$ sudo lsof -i 4tcp |grep ":http "
puma-dev 4383 root 5u IPv4 0xdd95588c6c9e0223 0t0 TCP localhost:http (LISTEN)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 31 (3 by maintainers)
@thom-nic I did previously have pow installed and I think that may have been the source of my problems
After running your suggested code to remove pow
rm -rf /etc/resover
sudo pfctl -F all
puma-dev -uninstall
sudo puma-dev -setup
puma-dev -install -d test
I was able to get puma dev to start working on port 80.
Ok so here’s something: https://superuser.com/a/598287/220180
launchd listens on port 80, as evidenced by:
And puma-dev is designed to have port 80 “handed off” from launchd a la xinetd. However unlike in the SO thread, I’m not and have never run apache httpd on this machine.
It got me thinking,
pow
does not work via launchd and I think uses some firewall rules instead. As a last ditch, I made sure any trace ofpow
was removed from my system. ref: http://get.pow.cx/uninstall.shWhen I ran
pfctl flush
the last line of output waspfctl: Anchor or Ruleset does not exist.
so I’m not sure that did anything pertinent. However at the moment I seem to now be able tocurl http://foo.test
with success!@bpollack @bullfight since you sound like you’re actually experiencing the same problem I was, suggest investigating whether any trace of pow remains on affected machine(s).
This might be related to https://github.com/puma/puma-dev/issues/66 ? I remember having to run
sudo pfctl -F all
after every reboot before puma-dev would work.@dmc2015 Interesting thought on whether the change in
localhost
might be related. But re EventMachine, this project is written in Go - regular Puma is written in Ruby but has its own I/O event reactor, too.Chrome is now forcing all
.dev
domains to HTTPS via pre-loaded HSTS. See here for further info: Related ArticleDon’t know if there’s a quick fix to this other than changing your local domain ext from
.dev
to something like.test