-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support HTTPS #274
Support HTTPS #274
Conversation
This should hopefully resolve #178. It uses the example given in the `micro` examples of `with-https`. It has some rough edges still that needed to be sanded down: * Choosing a specific short flag name for ssl (and if the initial flag should still be called ssl; I'm tempted to rename it to `https` or what have you). * The example always acks with 200 and the example object. * It does not support compression and merely overwrites the previous server var.
I should be able to get to last two bullet points without much delay; the first needs someone to chime in on design wise. I'm also aiming to do some general cleanup with what I've introduced so it's not entirely set in stone yet but I'm happy to oblige any changes needed. 🙂 |
This also calls `compress' on the handler when the `unzipped' flag is not present.
Last commit should resolve the latter two bullet points; just need to know if we should change the flag name? (I'm going to vote 'yes'! Maybe |
Also just realized there should probably be:
Looks like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic PR! 😊
I added a few comments. I think we can release it after you've made the changes and then add support for custom certs if anyone is requesting it. I personally don't see a need for that.
Also please resolve the conflicts! 🙏
lib/options.js
Outdated
}, | ||
{ | ||
name: 'ssl', | ||
description: 'Serve with ssl', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serve content using SSL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good; wasn't sure what the ideal copy was so I figured someone would eventually chime in 😉
key: cert.key, | ||
cert: cert.cert, | ||
passphrase: cert.passphrase | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a newline after this line 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 🙂
bin/serve.js
Outdated
@@ -4,6 +4,7 @@ | |||
const path = require('path') | |||
|
|||
// Packages | |||
const https = require('https') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a package - it needs to be part of the "Native" import group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing; force of habit to add to the end and glossed over the comments 🙂
Thanks! I'll be sure to run |
Per Per |
Should be good, and should also be using the appropriate non-master ( I am a little worried I didn't update the ava snapshots correctly, though. It looks like the generated markdown swapped the position of the regular and minimist options. If someone can chime in about that I'd appreciate it 😄 |
Thank you so much! I'll make sure to update the snapshots and lockfiles to be really sure. |
:nice: use of the micro example 👍 |
No worries, and thanks for writing that example, @albinekb! Make hacking up the diff a snap 👌 |
OSS FTW! 💯 👊 |
This needs documentation in the README. |
Does this feature has been disabled? The |
Indeed need documentation! I don't know what to do |
@justanotherdot What happened to your flag? The |
I am unsure I’m afraid. I was not responsible for the change removed the
flag. Looks like those new flags made their way in over at
#520
…On Thu, 13 Aug 2020 at 4:40 pm Nermin Skenderovic ***@***.***> wrote:
@justanotherdot <https://github.com/justanotherdot> What happened to your
flag? The --ssl flag doesn't work anymore and there's only --ssl-cert and
--ssl-key.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#274 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABI2FECNMQHOUTMKMPJAVGTSAODGLANCNFSM4D6TOCHA>
.
|
@leo why was support for automatic HTTPS removed? As per #520 and #511 it is understandable that users might want to use manual certs and keys, but there is still, no even more, use cases for automatic SSL/HTTPS. One of the biggest reasons why Personally I stumbled upon serve when building my create-react-app and wanted to "serve" it. But because I use service workers and push notifications I need to serve it over HTTPS so I can test on other devices on the network. Sure I can get HTTPS for my self as per #520, but my co-workers can't, since they might not have their own manual certs and keys... you see the problem? There is no reason why both manual and automatic HTTPS can't be supported. |
This should hopefully resolve #178. It uses the example given in the
micro
examples ofwith-https
. It has some rough edges still thatneeded to be sanded down:
Choosing a specific short flag name for ssl (and if the initial flag
should still be called ssl; I'm tempted to rename it to
https
or whathave you) - would like if someone chimed in about their design thoughts for this.
The example always acks with 200 and the example object - should just be a matter of passing off the handler as
fn
tomicroHttps
.It does not support compression and merely overwrites the previous
server var - should also be trivial, just compress the handler before handing it off to whichever server will take it.