add example with request module
This commit is contained in:
parent
13d73b89c0
commit
9bab728f8b
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var request = require('request');
|
||||
|
||||
var ca = fs.readFileSync(path.join(__dirname, 'certs', 'client', 'chain.pem'));
|
||||
var port = process.argv[2] || 8043;
|
||||
var hostname = process.argv[3] || 'localhost.daplie.com';
|
||||
|
||||
var options = {
|
||||
url: 'https://' + hostname + ':' + port
|
||||
, agentOptions: {
|
||||
ca: ca
|
||||
}
|
||||
};
|
||||
|
||||
request.get(options, function (err, resp) {
|
||||
console.log(resp.body);
|
||||
});
|
Loading…
Reference in New Issue