proxyRes not working
See original GitHub issueThis is my relevant code:
import browserSync from 'browser-sync'
const bs = browserSync.create()
let server;
bs.init({
proxy: {
target: 'localhost:8000',
proxyRes: [
(res,req,next) => {
req.body += 'hello'
next()
}
]
},
})
it says next is not a function
Also, it takes forever browsersync to start. There’s only two files to watch, although I don’t even really want browsersync to watch any files, but it takes like 10 - 15 seconds to start
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
typing for proxyRes seems to be incorrect · Issue #407 - GitHub
TypeScript expects proxyRes.headers to be an array of strings. Actual behavior. ✖ uncaughtException (an exception was thrown but not caught) ...
Read more >onProxyRes of http-proxy-middleware doesn't work for same ...
I'm trying to write a proxy using http-proxy-middleware that modifies the content of the response, and set some headers.
Read more >http-proxy-middleware - npm
Configure proxy middleware with ease for connect, express, browser-sync and many more. Powered by the popular Nodejitsu http-proxy . GitHub ...
Read more >node_modules/http-proxy · master - PLMlab
Contributing and Issues; License ... return the response by listening and acting on the proxyRes event ... Listen for the `proxyRes` event on...
Read more >Reverse proxy - Maapteh - Medium
As always the first version was done in an hour, but then the real problems started. We have to alter the Response header...
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
Idk what I did, but it’s working now
Code for anyone needing a fix:
Dude, it’s so long ago, I can’t remember…I pretty much gave up on browser sync cuz so many bugs