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

solr-proxy

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solr-proxy - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

2.1.0
=====
* Add SSL capability to the proxy.
2.0.0

@@ -2,0 +7,0 @@ =====

20

index.js

@@ -1,3 +0,2 @@

var http = require('http'),
httpProxy = require('http-proxy'),
var httpProxy = require('http-proxy'),
url = require('url'),

@@ -39,6 +38,4 @@ extend = require('xtend'),

var createServer = function(options) {
var proxyTarget = 'http://' + options.backend.host + ':' + options.backend.port;
var proxy = httpProxy.createProxyServer({target: options.backend});
var proxy = httpProxy.createProxyServer({target: proxyTarget});
proxy.on('error', function(err, req, res) {

@@ -49,4 +46,13 @@ res.writeHead(502, { 'Content-Type': 'text/plain' });

// adapted from http://git.io/k5dCxQ
var server = http.createServer(function(request, response) {
var createServer;
if (options.ssl) {
const https = require('https');
createServer = (callback) => https.createServer(options.ssl, callback);
} else {
const http = require('http');
createServer = http.createServer;
}
// adapted from https://git.io/k5dCxQ
var server = createServer(function(request, response) {
if (validateRequest(request, options)) {

@@ -53,0 +59,0 @@ debug('ALLOWED: ' + request.method + ' ' + request.url);

@@ -10,3 +10,3 @@ {

],
"version": "2.0.0",
"version": "2.1.0",
"author": "Rich Trott <rtrott@gmail.com>",

@@ -13,0 +13,0 @@ "bugs": {

@@ -75,2 +75,15 @@ solr-proxy

To enable TLS for your proxy, include an `ssl` object within the `options`
object.
```js
var options = {
ssl: {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem'),
}
};
var proxy = SolrProxy.start(null, options);
```
To enable verbose logging, set environment variable `DEBUG` to include `solr-proxy`.

@@ -77,0 +90,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