proxyReq provides no parameter
See original GitHub issueIssue details
The function listed in “proxyReq” is called with no parameter. As the parameter “proxyReq” is empty, the function “proxyReq.setHeader” (as in the example) doesn’t exist and we can’t accept the request.
Steps to reproduce/test case
"proxy": {
target: "localhost",
proxyReq: [
function (proxyReq) {
// proxyReq.setHeader('X-Special-Proxy-Header', 'foobar');
console.log(proxyReq.headers);
}
]
Please specify which version of Browsersync, node and npm you’re running
- Browsersync [ 2.17.0 ]
- Node [ 4.2.6 ]
- Npm [ 3.5.2 ]
Affected platforms
- [ X ] linux
- windows
- OS X
- freebsd
- solaris
- other (please specify which)
Browsersync use-case
- API
- Gulp
- Grunt
- CLI
If CLI, please paste the entire command below
{cli command here}
for all other use-cases, (gulp, grunt etc), please show us exactly how you’re using Browsersync
{Browsersync init code here}
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Edit POST parameters prior to forwarding to a proxy target and ...
Ok Here's the final solution. The following example allows you to inject POST parameters prior to forwarding to the proxy target.
Read more >ProxyRequest | Microsoft Learn
Calling ProxyRequest(sipRequestUri) to change request-uri in effect marks the request as routed without providing a request target.
Read more >mod_proxy - Apache HTTP Server Version 2.4
If set, all requests without session id will be redirected to the BalancerMember that has route parameter equal to this value. retry, 60,...
Read more >http-proxy-middleware - npm
Providing an alternative way to decide which requests should be proxied; In case you are not able to use the server's path parameter...
Read more >drachtio API
a Promise if no callback is provided, otherwise a reference to the Srf instance. ... If a function is provided, it will be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same issue here; browser-sync seems to change the configuration required to pass-through the Host header quite frequently.
From some source-diving I’ve figured out this solves it (
changeOrigin: false
):For anyone who finds themselves here, it seems changeOrigin is no longer a valid option.