diff --git a/.changeset/friendly-news-cry.md b/.changeset/friendly-news-cry.md new file mode 100644 index 000000000000..2d66a2ec83ef --- /dev/null +++ b/.changeset/friendly-news-cry.md @@ -0,0 +1,7 @@ +--- +"wrangler": patch +--- + +fix: pass localProtocol to miniflare for https server + +Closes #1247 diff --git a/packages/wrangler/src/dev/dev.tsx b/packages/wrangler/src/dev/dev.tsx index a9f62b321f9f..c54875a3955c 100644 --- a/packages/wrangler/src/dev/dev.tsx +++ b/packages/wrangler/src/dev/dev.tsx @@ -158,6 +158,7 @@ function DevSession(props: DevSessionProps) { bundle={props.bundle} format={props.entry.format} compatibilityDate={props.compatibilityDate} + localProtocol={props.localProtocol} compatibilityFlags={props.compatibilityFlags} bindings={props.bindings} assetPaths={props.assetPaths} diff --git a/packages/wrangler/src/dev/local.tsx b/packages/wrangler/src/dev/local.tsx index 7f86792795c7..55be1501630d 100644 --- a/packages/wrangler/src/dev/local.tsx +++ b/packages/wrangler/src/dev/local.tsx @@ -21,6 +21,7 @@ interface LocalProps { compatibilityDate: string; compatibilityFlags: string[] | undefined; bindings: CfWorkerInit["bindings"]; + localProtocol: "http" | "https"; assetPaths: AssetPaths | undefined; public: string | undefined; port: number; @@ -54,6 +55,7 @@ function useLocalWorker({ rules, enableLocalPersistence, ip, + localProtocol, crons, }: LocalProps) { // TODO: pass vars via command line @@ -164,6 +166,7 @@ function useLocalWorker({ name: workerName, port, scriptPath, + https: localProtocol === "https", host: ip, modules: format === "modules", modulesRules: (rules || []) @@ -298,6 +301,7 @@ function useLocalWorker({ workerName, format, port, + localProtocol, ip, bindings.durable_objects?.bindings, bindings.kv_namespaces,