https example

would it be possible to get an example of an https server (ie, with valid tlsOptions specified) in workerd?
2 Replies
jed
jedOP3y ago
const config :Workerd.Config = (
services = [
(name = "site-worker", worker = .siteWorker),
],

sockets = [
(name = "https", address = "*:443", https = (tlsOptions = .tlsOptions), service = "site-worker")
],
);

const tlsOptions :Workerd.TlsOptions = (
keypair = (
privateKey = embed "tls/key.pem",
certificateChain = embed "tls/cert.pem"
)
);
const config :Workerd.Config = (
services = [
(name = "site-worker", worker = .siteWorker),
],

sockets = [
(name = "https", address = "*:443", https = (tlsOptions = .tlsOptions), service = "site-worker")
],
);

const tlsOptions :Workerd.TlsOptions = (
keypair = (
privateKey = embed "tls/key.pem",
certificateChain = embed "tls/cert.pem"
)
);
jed
jedOP3y ago
GitHub
workerd/server-test.c++ at bdfb3cde62d5a91b5e5ef0b34b554ed8c3ef4568...
Contribute to cloudflare/workerd development by creating an account on GitHub.
Want results from more Discord servers?
Add your server