Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cdproxy

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cdproxy - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

4

index.js

@@ -35,5 +35,6 @@

var backendUrl = decodeURIComponent(req.url.substr( ("/" + prefix + "/").length )),
var backendUrl = req.url.substr( ("/" + prefix + "/").length ),
parsedUrl = url.parse(backendUrl);
console.log('index- backendUrl: ', backendUrl);

@@ -50,2 +51,3 @@ //adjust the req object.

}else{
console.log('sending https request to: ', backendUrl);
httpsProxy.proxyRequest(req, res, {

@@ -52,0 +54,0 @@ host: parsedUrl.hostname,

@@ -5,3 +5,3 @@ {

"main" : "index.js",
"version" : "0.0.1",
"version" : "0.0.2",
"dependencies" : {

@@ -8,0 +8,0 @@ "http-proxy" : "*"

var assert = require('assert'),
cdroxy = require('../'),
cdroxy = require('../'),
connect = require('connect'),
http = require('http'),
request = require('request');
request = require('request'),
url = require("url");

@@ -13,3 +14,7 @@

.use(function ( req, res ) {
res.end("response from remote");
var query = url.parse(req.url).query;
if (query)
res.end(query);
else
res.end("response from remote");
})

@@ -34,3 +39,2 @@ .listen(9000);

.get('http://localhost:8000/proxy/http://localhost:9000', function ( err, res, body ) {
assert.ok(!err);

@@ -43,2 +47,14 @@ assert.equal(res.statusCode, 200);

it('should proxy encoded characters', function ( done ) {
request
.get({
uri: 'http://localhost:8000/proxy/http://localhost:9000/',
qs: { q: 'foo bar' }
}, function ( err, res, body ) {
assert.equal(body, 'q=foo%20bar');
done();
});
});
it('should ignore urls outside /proxy/', function ( done ) {

@@ -45,0 +61,0 @@

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