Add new experimentalHttpsHostname option #70222
Open
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, I would like to propose a new
--experimental-https-hostname
option to allow to set a custom hostname just for the SSL certificate. This is needed because binding ports lower than 1024 on mac without root permissions is only possible when the hostname is left to0.0.0.0
, other values will result in the root permissions to be required.My use case is to run
next dev -p 443 --experimental-https
while a custom/etc/hosts
entry resolvers to 127.0.0.1.This means developers working on my project should be able to run
yarn dev
and be able to startcustom.local
to run the app with a valid self-signed certificate.Right now this requires root permissions, because of the attempt to bind to
custom.local
throughnext dev -p 443 --hostname custom.local --experimental-https
. But I don't really need to bind the dev server tocustom.local
, I just need the port 443 and the self-signed certificate forcustom.local
.