Skip to content

Commit 6870c18

Browse files
committed
Added new test file.
1 parent e5e55e6 commit 6870c18

1 file changed

Lines changed: 47 additions & 4 deletions

File tree

test/test-tmp.js

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,49 @@
11
require('../index');
2+
const Http = require('http');
3+
const Https = require('https');
4+
const Url = require('url');
25

3-
F.backup(F.path.root('semtu.package'), ['config-debug', 'my-config.txt', '/workers/'], function(err, filename) {
4-
console.log(filename);
5-
F.restore(filename, F.path.root('tmp'));
6-
});
6+
function rrr() {
7+
var options = { port: 8080, hostname: '127.0.0.1', method: 'CONNECT', headers: { host: 'www.totaljs.com:443' }};
8+
var req = Http.request(options);
9+
10+
req.on('connect', function(res, socket) {
11+
12+
console.log(res.statusCode);
13+
options = Url.parse('https://www.totaljs.com');
14+
15+
var agent = new Https.Agent();
16+
agent.reuseSocket(socket, req);
17+
options.agent = agent;
18+
19+
var r = Http.request(options);
20+
21+
r.on('response', function(res) {
22+
23+
res.on('data', function(data) {
24+
console.log(data.toString('utf8'));
25+
});
26+
27+
res.on('end', function() {
28+
agent.destroy();
29+
agent = null;
30+
socket.destroy();
31+
});
32+
});
33+
34+
r.end();
35+
36+
});
37+
38+
req.end();
39+
}
40+
41+
//U.request('http://www.vyvojari.sk', ['get', 'proxy http://127.0.0.1:8080'], console.log);
42+
43+
RESTBuilder.make(function(builder) {
44+
builder.url('https://www.spektrum-bb.sk');
45+
builder.proxy('127.0.0.1:8080');
46+
builder.exec(console.log);
47+
});
48+
49+
//rrr();

0 commit comments

Comments
 (0)