node-http-proxy
node-http-proxy copied to clipboard
Examples: <not work>
Examples:
I try with basic_proxy.js May be, hard requariments of unnecessary dependences.
I walk in this steps.
git clone https://github.com/http-party/node-http-proxy.git
npm install
node ./examples/http/basic-proxy.js
its fails, y see in the file basic-proxy require('colors') and require('util'), and then i install it
npm i -s colors util
Next, btw it fails,
util.puts(welcome.rainbow.bold);
^
TypeError: util.puts is not a function
at Object.<anonymous> (D:\Lamiwet\proxy\node-http-proxy\examples\http\basic-proxy.js:41:6)
at Module._compile (internal/modules/cjs/loader.js:1185:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
at Module.load (internal/modules/cjs/loader.js:1034:32)
at Function.Module._load (internal/modules/cjs/loader.js:923:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
Which version of node are you using? util.puts has been deprecated since v0.11.3 and finally removed in v12.x
Extract from v11.x documentation:
util.puts([...strings])
Deprecated: Use
console.log()instead.
I'm not using utils.puts sorry, the code of your exampes uses utls.puts
The example basic_proxy.js uses util.puts.
Couldn't find util.puts in node-util, the one installed by npm i -s util. So that wouldn't fix the error TypeError: util.puts is not a function.
The PR, Fix examples for node v12.x, should fix the error when merged. In the meantime you can manually edit the file and replace util.puts with console.log.
Ahh, ok, thanks
reverse-proxy.js has it too