GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: remove bypass option from proxy configuration by bjohansebas · Pull Request #5641 · webpack/webpack-dev-server

Conversation

@bjohansebas

@bjohansebas bjohansebas commented Jan 31, 2026

Copy link
Copy Markdown
Member

Summary

This removes the option to bypass the proxy.

What kind of change does this PR introduce?

Did you add tests for your changes?

Does this PR introduce a breaking change?

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@codecov

codecov Bot commented Jan 31, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.52%. Comparing base (230679d) to head (dce874a).
⚠️ Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #5641      +/-   ##
==========================================
- Coverage   83.62%   83.52%   -0.10%     
==========================================
  Files          11       11              
  Lines        1960     1936      -24     
  Branches      727      717      -10     
==========================================
- Hits         1639     1617      -22     
+ Misses        288      286       -2     
  Partials       33       33              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

alexander-akait
alexander-akait reviewed Feb 1, 2026
View reviewed changes
Comment thread test/server/proxy-option.test.js
return req.url;
}
},
},

@alexander-akait alexander-akait Feb 1, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rewrite these test to using new options from http-proxy-middleware

Also let's add in migration guide how to achive the same behaviour with new http proxy middleware

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
alexander-akait
alexander-akait reviewed Feb 1, 2026
View reviewed changes

@alexander-akait alexander-akait left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's improve couple things and we can merge

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bjohansebas reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bjohansebas
bjohansebas force-pushed the remove-bypass-option branch from 120842a to 67c0784 Compare February 2, 2026 01:16
@bjohansebas

bjohansebas commented Feb 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Okay, I’ve removed those two tests because neither router nor pathRewrite allows sending responses. The ServerResponse object is not available there, unlike in bypass. In router, only the req object and the options passed as arguments can be accessed, and the same applies to pathRewrite.

I’m working on adapting the other tests, because the behavior of bypass is completely different from what router and pathRewrite do.

Hmm, I think it’s not possible to recreate those tests. The reason is that with bypass, the request never went through http-proxy-middleware, so in the first tests it was able to redirect to /index.html. With proxies, that route no longer exists, which means we would likely need to create a new route in the proxies.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bjohansebas added 5 commits February 1, 2026 20:59
@bjohansebas
test: remove async bypass handling from proxy options
243e8d7
the router does not allow sending data the way bypass did. In the router we only have the req object, so this test is removed since it is invalid (https://github.com/chimurai/http-proxy-middleware/blob/6436ffc522a3a2485c198bd2fb544db0e33e3821/src/router.ts#L7)
@bjohansebas
test: remove another test
76c0862
 Just like in the previous commit, the router, or any other handler ,does not allow sending data; it only changes where the request should be forwarded via the proxy. Therefore, it doesn’t make sense to keep this test.
@bjohansebas
test: remove deprecated bypass option tests
98bdf5a
@bjohansebas
test: use only pathRewrite
e3aba33
@bjohansebas
feat: remove deprecated bypass option from proxy configuration
d725363
@bjohansebas
bjohansebas force-pushed the remove-bypass-option branch from cf32348 to d725363 Compare February 2, 2026 02:00
bjohansebas
bjohansebas commented Feb 2, 2026
View reviewed changes
Comment thread test/server/proxy-option.test.js Outdated
},
{
context: "/bypass-with-target",
pathFilter: "**/*.html",

@bjohansebas bjohansebas Feb 2, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect that using router: "() => http://localhost:${port3}" should work and be somewhat similar to what bypass did, but it doesn’t fully work. I’m still thinking about a way to recreate bypass.

With bypass, the request never went through the proxy, which is why it could return index.html from the webpack-dev-server itself. Now we need to find a way for the request to go through the proxy and still reach the original server, without having to create a new route in the proxy.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bjohansebas
bjohansebas commented Feb 2, 2026
View reviewed changes
Comment thread test/server/proxy-option.test.js
Comment on lines -298 to -304
it("should wait if bypass returns promise", async () => {
const response = await req.get("/proxy/async");

expect(response.status).toBe(200);
expect(response.text).toContain("proxy async response");
});

@bjohansebas bjohansebas Feb 2, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither router nor pathRewrite can send data directly since they don’t have access to the res object. So either it gets removed, or a new route is created in the proxy — but I’m not sure what the point of that would be.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@chimurai chimurai Jun 21, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bjohansebas

res and options are accessible in router and pathRewrite (Since 4.1.0)

chimurai/http-proxy-middleware#1247
chimurai/http-proxy-middleware#1244

Release: https://github.com/chimurai/http-proxy-middleware/releases/tag/v4.1.0

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bjohansebas bjohansebas Jun 23, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @chimurai see #5689

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bjohansebas
bjohansebas commented Feb 2, 2026
View reviewed changes
Comment thread test/server/proxy-option.test.js
expect(response.text).toContain("from proxy2");
});

it("should allow req, res, and next", async () => {

@bjohansebas bjohansebas Feb 2, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same https://github.com/webpack/webpack-dev-server/pull/5641/changes#r2752370675

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chimurai reacted with eyes emoji
All reactions
  • 👀 1 reaction
bjohansebas added 2 commits February 2, 2026 10:10
@bjohansebas
test: improve tests
44712d3
@bjohansebas
test: update pathFilter in proxy option tests
e61d44b
alexander-akait
alexander-akait approved these changes Feb 2, 2026
View reviewed changes

@alexander-akait alexander-akait left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to merge

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bjohansebas added 4 commits February 2, 2026 10:50
@bjohansebas
docs: update migration guide to reflect removal of bypass function in…
051176c
… proxy configuration
@bjohansebas
chore: update examples
bdb9c1a
@bjohansebas
fixup!
b5fb00d
@bjohansebas
docs: update migration guide to clarify minimum webpack version requi…
dce874a
…rement
alexander-akait
alexander-akait approved these changes Feb 2, 2026
View reviewed changes
@bjohansebas bjohansebas closed this Feb 2, 2026
@bjohansebas bjohansebas reopened this Feb 2, 2026
@bjohansebas
bjohansebas merged commit a4012b6 into next Feb 3, 2026
155 of 200 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bjohansebas
bjohansebas deleted the remove-bypass-option branch February 3, 2026 03:57
bjohansebas added a commit that referenced this pull request May 23, 2026
@bjohansebas
feat: remove bypass option from proxy configuration (#5641)
f2a8809
* test: remove async bypass handling from proxy options

the router does not allow sending data the way bypass did. In the router we only have the req object, so this test is removed since it is invalid (https://github.com/chimurai/http-proxy-middleware/blob/6436ffc522a3a2485c198bd2fb544db0e33e3821/src/router.ts#L7)

* test: remove another test

 Just like in the previous commit, the router, or any other handler ,does not allow sending data; it only changes where the request should be forwarded via the proxy. Therefore, it doesn’t make sense to keep this test.

* test: remove deprecated bypass option tests

* test: use only pathRewrite

* feat: remove deprecated bypass option from proxy configuration

* test: improve tests

* test: update pathFilter in proxy option tests

* docs: update migration guide to reflect removal of bypass function in proxy configuration

* chore: update examples

* fixup!

* docs: update migration guide to clarify minimum webpack version requirement
bjohansebas added a commit that referenced this pull request Jun 12, 2026
@bjohansebas
feat: remove bypass option from proxy configuration (#5641)
a0b16fc
* test: remove async bypass handling from proxy options

the router does not allow sending data the way bypass did. In the router we only have the req object, so this test is removed since it is invalid (https://github.com/chimurai/http-proxy-middleware/blob/6436ffc522a3a2485c198bd2fb544db0e33e3821/src/router.ts#L7)

* test: remove another test

 Just like in the previous commit, the router, or any other handler ,does not allow sending data; it only changes where the request should be forwarded via the proxy. Therefore, it doesn’t make sense to keep this test.

* test: remove deprecated bypass option tests

* test: use only pathRewrite

* feat: remove deprecated bypass option from proxy configuration

* test: improve tests

* test: update pathFilter in proxy option tests

* docs: update migration guide to reflect removal of bypass function in proxy configuration

* chore: update examples

* fixup!

* docs: update migration guide to clarify minimum webpack version requirement
@bjohansebas bjohansebas mentioned this pull request Jun 23, 2026
chore: update http-proxy-middleware to version 4.1.1 #5689
Merged
bjohansebas added a commit that referenced this pull request Jul 1, 2026
@bjohansebas
feat: remove bypass option from proxy configuration (#5641)
160bec4
* test: remove async bypass handling from proxy options

the router does not allow sending data the way bypass did. In the router we only have the req object, so this test is removed since it is invalid (https://github.com/chimurai/http-proxy-middleware/blob/6436ffc522a3a2485c198bd2fb544db0e33e3821/src/router.ts#L7)

* test: remove another test

 Just like in the previous commit, the router, or any other handler ,does not allow sending data; it only changes where the request should be forwarded via the proxy. Therefore, it doesn’t make sense to keep this test.

* test: remove deprecated bypass option tests

* test: use only pathRewrite

* feat: remove deprecated bypass option from proxy configuration

* test: improve tests

* test: update pathFilter in proxy option tests

* docs: update migration guide to reflect removal of bypass function in proxy configuration

* chore: update examples

* fixup!

* docs: update migration guide to clarify minimum webpack version requirement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@alexander-akait alexander-akait alexander-akait approved these changes
+1 more reviewer
@chimurai chimurai chimurai left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@bjohansebas @chimurai @alexander-akait
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.