Skip to content

Navigation Menu

Sign in
Sign up

🔀 Add support for HTTPS dev server - #175

Open
gungun974 wants to merge 3 commits into
lustre-labs:main from
gungun974:tls
Open

🔀 Add support for HTTPS dev server #175
gungun974 wants to merge 3 commits into
lustre-labs:main from
gungun974:tls

Conversation

@gungun974

@gungun974 gungun974 commented Aug 17, 2026

Copy link
Copy Markdown

With this PR lustre dev tool can now serve in HTTPS
You just need to provide a cert and a key automatically on port 1235 (default one) a port with TLS enabled will be available

✅ Server started on http:/127.0.0.1:1234
✅ Server started on https://127.0.0.1:1235
[tools.lustre.dev]
cert = "certs/dev-cert.pem"
key = "certs/dev-key.pem"
https_port = 1235

For the CLI it's --cert and --key and --https-port (I'm unsure for the name of https-port)

Copy link
Copy Markdown
Contributor

Does the port have to be separate or could we handle https traffic on the same port as insecure traffic?

Copy link
Copy Markdown
Author

Does the port have to be separate or could we handle https traffic on the same port as insecure traffic?

Well HTTP and HTTPS are separated protocol. By default it's 80 and 443 and they don't start in the same way.

Maybe the server could detect if the client try to start a new TLS session and it could than switch from regular HTTP to HTTPS traffic but I feel we would need to ditch mist (or ewe) to directly listen to the TCP socket to do those kind of hack.

What I mean is generally HTTP and HTTPS are on different port since they are kind of their own different service. If I take vite and enabled https. It will just replace the http:// with https:// and make the server incompatible with http://.

I only saw projects like Caddy or Nginx that would detect if the traffic start with TLS or not and that's generally just for redirecting the user to HTTPS.

Copy link
Copy Markdown
Contributor

If I take vite and enabled https. It will just replace the http:// with https:// and make the server incompatible with http://.

This sounds ok to me, if you're opting into https you probably wont open the http version anyway right?

Copy link
Copy Markdown
Author

If I take vite and enabled https. It will just replace the http:// with https:// and make the server incompatible with http://.

This sounds ok to me, if you're opting into https you probably wont open the http version anyway right?

I need to think more about this because it’s kind of depend. Like for when I did needed use https I did generated with mkcert a personal CA certificate that I did install on my dev device to trust it but if I don’t (or can’t install) I know the not secure port is also still useful.

But yeah is having both HTTP and HTTPS available at the same time is useful or fully switched to HTTPS would be preferable. Like said I need to think a little more

Copy link
Copy Markdown
Author

Yah I think you are right and just having like every other dev server adding the Cert and Key should just switch from HTTP to HTTPS. (so I updated this PR to reflect this)

hayleigh-dot-dev reacted with heart emoji

Copy link
Copy Markdown
Contributor

I guess you could always run it twice if you want the non-https one too.

@hayleigh-dot-dev hayleigh-dot-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some small changes i think but looks great otherwise, super nice!

Comment thread src/lustre/dev.gleam Outdated
Comment thread src/lustre/dev.gleam Outdated

Copy link
Copy Markdown
Author

Should be okay now. At least it depend if you find the new documentation and errors message could be improve ^^ (I hate writing english documentation)

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

Reviewers

@hayleigh-dot-dev hayleigh-dot-dev Awaiting requested review from hayleigh-dot-dev

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /