New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-ral

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ral - npm Package Compare versions

Comparing version 0.0.22 to 0.0.23

18

lib/ext/protocol/httpProtocol.js

@@ -15,3 +15,2 @@ /*

var urlencode = require('urlencode');
var http = require('http');

@@ -33,2 +32,5 @@ function HttpProtocol(){

}
if (typeof config.rejectUnauthorized == 'undefined'){
config.rejectUnauthorized = true;
}
return config;

@@ -56,4 +58,16 @@ };

};
var request;
if (config.https){
request = require('https');
opt.key = config.key;
opt.cert = config.cert;
opt.rejectUnauthorized = config.rejectUnauthorized
}else{
request = require('http');
}
logger.trace('request start ' + JSON.stringify(opt));
var req = http.request(opt, function(res){
var req = request.request(opt, function(res){
if (res.statusCode >= 300) {

@@ -60,0 +74,0 @@ req.emit('error', new Error('Server Status Error: ' + res.statusCode));

2

package.json
{
"name": "node-ral",
"version": "0.0.22",
"version": "0.0.23",
"description": "a rpc client for node",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -133,2 +133,19 @@ /*

});
it.only('should work well with https', function(done) {
var get_test = require('./protocol/http_protocol_get_test.js');
//start a http server for get
// var server = get_test.createServer();
var httpProtocol = new HttpProtocol();
var context = HttpProtocol.normalizeConfig(get_test.request_https);
var stream = httpProtocol.talk(context, function(res){
res.on('data', function(data){
done();
});
});
stream.on('error', function(err){
console.log(err);
err.should.be.null;
})
});
});

@@ -135,0 +152,0 @@

@@ -53,2 +53,13 @@ /*

module.exports.request_https = {
https: true,
method: 'GET',
path: '/v2/?login',
rejectUnauthorized: false,
server : {
host : 'passport.baidu.com',
port: 443
}
};
module.exports.createServer = function(){

@@ -55,0 +66,0 @@ return http.createServer(function (request, response) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc