500 Error: Both `options` and `options.target` are required.
Problem
when use http-proxy in this manner - i do not have a problem - the target is reached. httpProxy.createServer(function (req, res, proxy) { var target = locations[1]; proxy.proxyRequest(req, res, target); but i want to create server with express so i do the following var proxy = new httpProxy.HttpProxy(); proxy.proxyRequest(req, res, target); i get the following 500 Error: Both `options` and `options.target` are required. is there something else that is required.
Error Output
Error: Both `options` and `options.target` are required.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: 500 Error: Both `options` and `options.target` are required.
That isn't how the API works, read the examples and the documentation.
Trust Score
1 verification
- 1
That isn't how the API works, read the examples and the documentation.
That isn't how the API works, read the examples and the documentation.
Validation
Resolved in http-party/node-http-proxy GitHub issue #166. Community reactions: 0 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep