Skip to content

Commit

Permalink
feat: disable tunnel in wrangler dev (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
threepointone authored Mar 7, 2022
1 parent 66bb15d commit bc85682
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
9 changes: 9 additions & 0 deletions .changeset/eleven-bananas-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"wrangler": patch
---

feat: disable tunnel in `wrangler dev`

Disables sharing local development server on the internet. We will bring this back after it's more polished/ready.

Fixes https://github.com/cloudflare/wrangler2/issues/550
15 changes: 5 additions & 10 deletions packages/wrangler/src/dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ function Dev(props: DevProps): JSX.Element {
)}
<Box borderStyle="round" paddingLeft={1} paddingRight={1}>
<Text>
{`B to open a browser, D to open Devtools, S to ${
toggles.tunnel ? "turn off" : "turn on"
} (experimental) sharing, L to ${
{`B to open a browser, D to open Devtools, L to ${
toggles.local ? "turn off" : "turn on"
} local mode, X to exit`}
</Text>
Expand Down Expand Up @@ -835,6 +833,10 @@ async function findTunnelHostname() {
return hostName;
}

/**
* Create a tunnel to the remote worker.
* We've disabled this for now until we figure out a better user experience.
*/
function useTunnel(toggle: boolean) {
const tunnel = useRef<ReturnType<typeof spawn>>();
const removeSignalExitListener = useRef<() => void>();
Expand Down Expand Up @@ -924,13 +926,6 @@ function useHotkeys(
);
break;
}
// toggle tunnel
case "s":
setToggles((previousToggles) => ({
...previousToggles,
tunnel: !previousToggles.tunnel,
}));
break;
// toggle local
case "l":
setToggles((previousToggles) => ({
Expand Down

0 comments on commit bc85682

Please sign in to comment.