Skip to content
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

Option for enabling HTTPS #178

Closed
Queatz opened this issue Apr 29, 2017 · 12 comments · Fixed by #274
Closed

Option for enabling HTTPS #178

Queatz opened this issue Apr 29, 2017 · 12 comments · Fixed by #274

Comments

@Queatz
Copy link

Queatz commented Apr 29, 2017

Any way to do it or is it planned?

@albinekb
Copy link

It's recommended to add nginx proxy or similar as SSL termination, it's not performant enough in node.

@albinekb
Copy link

vercel/micro#224

@DanielBaird
Copy link

+1 for this request.

For me serve has a use case of "quickly check something local in a browser". In that situation it's much better to have SSL built in, even if it's slow. When I'm working on a javascript SPA or a D3 visualisation, or I'm quickly looking over a site design for a colleague, I want a quick one-liner that works immediately -- I don't want to take the time to set up an nginx https proxy.

Maybe it's out of scope or more work than the devs want to do, but I think "it would be slower than nginx" isn't an argument against adding TLS/HTTPS to this tool.

@mrmartineau
Copy link

@DanielBaird did you ever find something that would do SSL like serve? I need something to test Service Workers on my Jekyll site..

@DanielBaird
Copy link

@mrmartineau Best so far is Caddy ( https://caddyserver.com ), where something like

sudo caddy -host myproject.com

...will start serving the current dir at myproject.com via http and https using a cert from letsencrypt.

@albinekb
Copy link

@mrmartineau Do you need ssl just for localhost?

@mrmartineau
Copy link

@DanielBaird thanks for the tip, I will give it a try.

@albinekb yes.

Both, I've been using firebase serve to do this but it is too complicated to setup for many projects.

@leo
Copy link
Contributor

leo commented Jun 20, 2017

I'm happy to accept a PR for this!

@leo leo changed the title HTTPS support? Option for enabling HTTPS Jun 20, 2017
@kitsunekyo
Copy link

maybe a collaboration /merge would be great between the two of you guys.
I've been using this package until i've heard of "serve".

https://github.com/indexzero/http-server

@justanotherdot
Copy link
Contributor

I've a semi-working branch for this and I'll try to submit a PR as soon as I sand off some of the rough edges. 🙂

@leo leo closed this as completed in #274 Oct 17, 2017
leo pushed a commit that referenced this issue Oct 17, 2017
* Support HTTPS

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.

* Pass appropriate handler to https server

This also calls `compress' on the handler when the `unzipped' flag is
not present.

* Move https import to appropriate section

* Change SSL flag copy

* Merge in master to update package-lock.json

* Address conflicts

* Use master package-lock.json to avoid conflicts

* Make travis happy by updating ava snapshots

* Fix sha1 to sha512 flipping per npm 5.3.0 issue
@devinrhode2
Copy link

I struggled to get caddy to work. I ended up using http-server instead (npm install -g http-server)

@Tapudp
Copy link

Tapudp commented Dec 31, 2020

Thank you so much @devinrhode2 , after a long day searching finally http-server worked well. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants