node-net-proxy
A simple net http https forwarding proxy! Like smartProxy and vpn's! You can use it with your browser or your system to go out!
So if set in an external server! You can change your IP using it!
You can learn and understand some of the basics of a forwarding proxy! As this use the net module! And so all play at the TCP level!
You can build upon it too! And take it as a base!
Research things like http tunneling! And CONNECT http Method! And BOSH!
- https://en.wikipedia.org/wiki/HTTP_tunnel
- https://en.wikipedia.org/wiki/BOSH_(protocol)
- CONNECT METHOD.
- CONNECT METHOD (StackOverflow)
And this module is a great piece to create proxies for testing! That was our usage at our company!
And we use it as simple forwarding proxy too!
This proxy use the http CONNECT method for https (end to end tunnel and encryption). And simple forwarding for http.
Typescript
Build using typescript! And fully support typing!
Install
npm install net-proxy --save
How to use
We use the class ProxyServer
Class Signature:
import
;
Init
// init; // waiting for the server to startproxy.awaitStartedListening .then .catch;
Another example
; proxy.server.on'data',; await proxy.awaitStartedListening; // await server to start // After server started ; ; ; // this call will pass through the proxy