Commits
Tarun Sukhani authored 0bbe9b8c5a7
feat: enable-https now also binds HTTP on port 9000 alongside HTTPS (release 1.12.20)
PF-67 follow-up: with only https.port=9443 set, the framework's
special-case fallback at Server.java:56 ("if both http.port AND
https.port are -1, default httpPort to 9000") no longer fires —
httpPort stays at -1 and the plain HTTP listener never binds.
Result: enable-https on a fresh app left users with HTTPS-only,
which silently broke any "hit http and get redirected" or "test
locally with curl http://" workflow.
Fix: enable-https now also _set_or_uncomment's http.port=9000
when no active http.port line is present. The skeleton's
`# http.port=9000` at line 41 of resources/application-skel/conf/
application.conf gets uncommented in place, so users see the
expected line in their config.
Preservation: a user-customized http.port (e.g. http.port=8080
for a non-default port, or http.port=-1 for HTTPS-only) is
preserved across enable-https runs — the command only sets the
default when no active line exists. The "already enabled" check
also requires an active http.port line, so re-running enable-https
with a custom port is correctly a no-op.
Status message reflects the actual active port: "HTTP enabled on
port 9000" for the default, "HTTP enabled on port 8080" for a
custom value, "HTTP listener stays disabled per existing
http.port=-1 setting" for the HTTPS-only case.
End-to-end verified on a fresh app:
$ play new bothports && cd bothports && play enable-https
~ HTTP enabled on port 9000.
~ HTTPS enabled on port 9443 with HTTP/2 (ALPN h2) negotiation.
$ play start
Listening for HTTP on port 9000 (Waiting a first request ...)
Listening for HTTPS on port 9443 (Waiting a first request ...)
$ curl -s http://localhost:9000/ → 200, HTTP/1.1
$ curl -ks https://localhost:9443/ → 200, HTTP/2
$ curl -kvs --http2 https://localhost:9443/
* ALPN: server accepted h2
cmd-enable-https.txt updated to document the fourth step
(http.port handling), the framework's fallback semantics, and the
expected dual startup log lines.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>