Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 33 lines (25 sloc) 0.613 kb
8443b92 @substack examples and a readme
substack authored
1 prox
2 ====
3
4 Network proxy server and client module.
5
6 Examples
7 ========
8
9 server.js
10 ---------
11 var socks5 = require('prox').socks5;
b15c9b6 @substack updated readme and examples for new more http-style interface
substack authored
12 socks5.createServer(function (req, res) {
13 res.write('Requested ' + req.host + ':' + req.port);
8443b92 @substack examples and a readme
substack authored
14 }).listen(7890)
15
16 client.js
17 ---------
18 var socks5 = require('prox').socks5;
19
20 var stream = socks5.createConnection('localhost', 7890)
21 .connect('substack.net', 1337);
22
23 stream.on('data', function (buf) {
24 console.log(buf.toString());
25 });
26
27 output
28 ------
29 $ node server.js &
30 [1] 32058
31 $ node client.js
32 Requested substack.net:1337
Something went wrong with that request. Please try again.