You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 6, 2024. It is now read-only.
This adds support for processing HTTPS requests on a separate port from
the usual HTTP requests. It does so by adding options for specifying the
path to a TLS key and a TLS certificate.
This can be useful for testing worker scripts that do things like custom
redirects depending on whether the user is making an encrypted request
or not.
Note: This PR does not yet set special `request.cf` attributes such as
`tlsVersion` and `tlsCipher` as described here:
https://developers.cloudflare.com/workers/reference/request-attributes/
Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,9 @@ Options:
42
42
-w, --wasm [variable=path] Binds variable to wasm located at path (default: [])
43
43
-c, --enable-cache Enables cache <BETA>
44
44
-r, --watch Watch the worker script and restart the worker when changes are detected
45
+
--tls-key <tlsKey> Optional. Path to encryption key for serving requests with TLS enabled. Must specify --tls-cert when using this option.
46
+
--tls-cert <tlsCert> Optional. Path to certificate for serving requests with TLS enabled. Must specify --tls-key when using this option.
47
+
--https-port <httpsPort> Optional. Port to listen on for HTTPS requests. Must specify --tls-cert and --tls-key when using this option. May not be the same value as --port.
.option('-r, --watch','Watch the worker script and restart the worker when changes are detected',false)
26
26
.option('-s, --set [variable.key=value]','(Deprecated) Binds variable to a local implementation of Workers KV and sets key to value',collect,[])
27
+
.option('--tls-key <tlsKey>','Optional. Path to encryption key for serving requests with TLS enabled. Must specify --tls-cert when using this option.')
28
+
.option('--tls-cert <tlsCert>','Optional. Path to certificate for serving requests with TLS enabled. Must specify --tls-key when using this option.')
29
+
.option('--https-port <httpsPort>','Optional. Port to listen on for HTTPS requests. Must specify --tls-cert and --tls-key when using this option. May not be the same value as --port.',3001)
27
30
.action(f=>{file=f})
28
31
.parse(process.argv)
29
32
@@ -50,10 +53,44 @@ function run (file, wasmBindings) {
50
53
// Add a warning log for deprecation
51
54
if(program.set.length>0)console.warn('Warning: Flag --set is now deprecated, please use --kv-set instead')
0 commit comments