Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: server proxy #205

Closed
Tracked by #12
threepointone opened this issue Jan 7, 2022 · 0 comments · Fixed by #231
Closed
Tracked by #12

enhance: server proxy #205

threepointone opened this issue Jan 7, 2022 · 0 comments · Fixed by #231
Labels
enhancement New feature or request

Comments

@threepointone
Copy link
Contributor

During wrangler dev, we start a proxy server to act as an intermediary to the worker running on the edge. This proxy adds relevant headers, and acts as a stable URL during development, which is pretty good. There are some problems with our approach -

  • We only start the server after we receive a token from the preview service, so if we open the browser tab before that we simply see a generic ERR_CONNECTION_REFUSED page in the browser (i.e - the server doesn't 'exist')
  • When we make a change to the worker, we drop the connection, meaning if someone refreshes the browser they see the same ERR_CONNECTION_REFUSED page again.
  • This makes the iteration process feel slow and broken. We should be able to buffer requests while we start/restart the server, so the user's workflow isn't broken.

We should fix this before GA. I'll get to it at the end if no one else does, but I'm happy to help anyone who'd like to take a crack at it.

@threepointone threepointone added the enhancement New feature or request label Jan 7, 2022
@threepointone threepointone changed the title enahnce: server proxy enhance: server proxy Jan 7, 2022
@threepointone threepointone mentioned this issue Jan 7, 2022
27 tasks
threepointone added a commit that referenced this issue Jan 11, 2022
Closes #205

This PR refactors how we setup the proxy server between the developer and the edge preview service during `wrangler dev`. Of note, we start the server immediately. We also buffers requests/streams and hold on to the, when starting/refreshing the token. This means a developer should never see `ERR_CONNECTION_REFUSED` error page, or have an older worker respond after making a change to the code. When the token does get refreshed, we flush said streams/requests with the newer values.
-
threepointone added a commit that referenced this issue Jan 11, 2022
Closes #205

This PR refactors how we setup the proxy server between the developer and the edge preview service during `wrangler dev`. Of note, we start the server immediately. We also buffers requests/streams and hold on to the, when starting/refreshing the token. This means a developer should never see `ERR_CONNECTION_REFUSED` error page, or have an older worker respond after making a change to the code. When the token does get refreshed, we flush said streams/requests with the newer values.
threepointone added a commit that referenced this issue Jan 12, 2022
Closes #205

This PR refactors how we setup the proxy server between the developer and the edge preview service during `wrangler dev`. Of note, we start the server immediately. We also buffers requests/streams and hold on to the, when starting/refreshing the token. This means a developer should never see `ERR_CONNECTION_REFUSED` error page, or have an older worker respond after making a change to the code. When the token does get refreshed, we flush said streams/requests with the newer values.
threepointone added a commit that referenced this issue Jan 12, 2022
Closes #205

This PR refactors how we setup the proxy server between the developer and the edge preview service during `wrangler dev`. Of note, we start the server immediately. We also buffers requests/streams and hold on to the, when starting/refreshing the token. This means a developer should never see `ERR_CONNECTION_REFUSED` error page, or have an older worker respond after making a change to the code. When the token does get refreshed, we flush said streams/requests with the newer values.
threepointone added a commit that referenced this issue Jan 12, 2022
Closes #205

This PR refactors how we setup the proxy server between the developer and the edge preview service during `wrangler dev`. Of note, we start the server immediately. We also buffers requests/streams and hold on to the, when starting/refreshing the token. This means a developer should never see `ERR_CONNECTION_REFUSED` error page, or have an older worker respond after making a change to the code. When the token does get refreshed, we flush said streams/requests with the newer values.
@petebacondarwin petebacondarwin moved this to Done in workers-sdk Jan 25, 2022
@petebacondarwin petebacondarwin added this to the Wrangler 2.0 milestone Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants