0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-01-13 22:51:08 -05:00
caddy/caddyhttp/httpserver
Matthew Holt e3f2d96a5e
httpserver: Flags to customize HTTP and HTTPS ports (incl. for ACME)
This commit removes _almost_ all instances of hard-coded ports 80 and
443 strings, and now allows the user to define what the HTTP and HTTPS
ports are by the -http-port and -https-ports flags.

(One instance of "80" is still hard-coded in tls.go because it cannot
import httpserver to get access to the HTTP port variable. I don't
suspect this will be a problem in practice, but one workaround would be
to define an exported variable in the caddytls package and let the
httpserver package set it as well as its own HTTPPort variable.)

The port numbers required by the ACME challenges HTTP-01 and TLS-SNI-01
are hard-coded into the spec as ports 80 and 443 for good reasons,
but the big question is whether they necessarily need to be the HTTP
and HTTPS ports. Although the answer is probably no, they chose those
ports for convenience and widest compatibility/deployability. So this
commit also assumes that the "HTTP port" is necessarily the same port
on which to serve the HTTP-01 challenge, and the "HTTPS port" is
necessarily the same one on which to serve the TLS-SNI-01 challenge. In
other words, changing the HTTP and HTTPS ports also changes the ports
the challenges will be served on.

If you change the HTTP and HTTPS ports, you are responsible for
configuring your system to forward ports 80 and 443 properly.

Closes #918 and closes #1293. Also related: #468.
2017-03-06 18:18:49 -07:00
..
condition.go Fix small misspellings 2017-01-10 13:09:24 -08:00
condition_test.go Fix misspellings 2016-09-05 10:20:34 -06:00
context.go httpserver: Flags to customize HTTP and HTTPS ports (incl. for ACME) 2017-03-06 18:18:49 -07:00
context_test.go Ensure some tests remove temporary directories they created 2016-11-28 22:26:54 -07:00
error.go add more descriptive errors 2016-10-11 10:34:51 +08:00
https.go httpserver: Flags to customize HTTP and HTTPS ports (incl. for ACME) 2017-03-06 18:18:49 -07:00
https_test.go httpserver: Flags to customize HTTP and HTTPS ports (incl. for ACME) 2017-03-06 18:18:49 -07:00
logger.go Feature #1246 - Remote syslog (#1301) 2017-02-08 08:02:09 -07:00
logger_test.go Feature #1246 - Remote syslog (#1301) 2017-02-08 08:02:09 -07:00
middleware.go Clarify godoc for HTTP handler signature 2016-08-25 17:13:49 -06:00
middleware_test.go
mitm.go Use RequestURI when redirecting to canonical path. (#1331) 2017-02-28 05:54:12 -07:00
mitm_test.go Use RequestURI when redirecting to canonical path. (#1331) 2017-02-28 05:54:12 -07:00
path.go Proposal: Middleware Config (#908) 2016-07-08 18:12:52 -06:00
pathcleaner.go Implementing custom PathClean function to allow masking, closes #1298 (#1317) 2016-12-31 20:29:14 -07:00
pathcleaner_test.go Implementing custom PathClean function to allow masking, closes #1298 (#1317) 2016-12-31 20:29:14 -07:00
plugin.go httpserver: Flags to customize HTTP and HTTPS ports (incl. for ACME) 2017-03-06 18:18:49 -07:00
plugin_test.go Add tests for case insensitivity of keys and saving contexts 2016-09-24 13:24:33 -06:00
recorder.go HTTP/2 push support (golang 1.8) (#1215) 2017-02-17 09:25:22 -07:00
recorder_test.go
replacer.go Use RequestURI when redirecting to canonical path. (#1331) 2017-02-28 05:54:12 -07:00
replacer_test.go Add request placeholder support for querying request cookies. (#1392) 2017-02-15 21:59:24 -07:00
roller.go Roll all logs by default (#1379) 2017-02-08 09:23:33 -07:00
server.go Use RequestURI when redirecting to canonical path. (#1331) 2017-02-28 05:54:12 -07:00
server_test.go tls: Refactor internals related to TLS configurations (#1466) 2017-02-21 09:49:22 -07:00
siteconfig.go New 'timeouts' directive to configure timeouts; default timeouts enabled (#1368) 2017-01-24 08:15:25 -07:00
vhosttrie.go Don't treat localhost specially when assigning bind address 2016-06-27 13:14:28 -06:00
vhosttrie_test.go