https://github.com/springmeyer/node-request-proxy-test
Test code for understanding and debugging proxies with node.js
https://github.com/springmeyer/node-request-proxy-test
Last synced: 7 months ago
JSON representation
Test code for understanding and debugging proxies with node.js
- Host: GitHub
- URL: https://github.com/springmeyer/node-request-proxy-test
- Owner: springmeyer
- Created: 2014-03-31T19:44:38.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-03-31T19:55:15.000Z (about 12 years ago)
- Last Synced: 2024-12-28T18:28:18.881Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 121 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### proxy test
## Depends
- Node.js v0.10.x
## Setup
Install dependencies:
npm install
NOTE: if you need the installation to work behind a proxy, then you need to set up npm to know your proxy. See http://jjasonclark.com/how-to-setup-node-behind-web-proxy for more details.
## Testing
#### With mock proxy
In one terminal start the server:
node server.js
In another terminal run the test:
node test.js
After several seconds you should see:
test passed successfully!
#### With real proxy
Stop the server.js (no need for it now).
Set the environment setting of `HTTP_PROXY` then run:
export HTTP_PROXY=http://user:pass@hostname:port
node test.js
After several seconds you should see:
test passed successfully!
## Troubleshooting
If you see the error `Error: Invalid protocol` then it means your `HTTP_PROXY` setting was invalid.