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

loadfire

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loadfire - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

39

lib/groupbalancer.js

@@ -6,2 +6,5 @@ // Requires

var httpProxy = require('http-proxy');
function GroupBalancer(config, resources) {

@@ -84,3 +87,3 @@ // Bind methods to resource

.then(function() {
console.log('backend =', backend);
console.log('Handled: ', backend.host+req.url);

@@ -97,3 +100,7 @@ // Handle (actual proxying)

.fail(function(err) {
req.resume();
console.log('HTTP ERROR=');
console.log(err.stack);
res.write(err.stack);

@@ -106,2 +113,3 @@ res.write('\nERROR: Loadfire does not know how to handle that request\n');

GroupBalancer.prototype.handleWs = function(req, socket, head) {
var self = this;

@@ -116,16 +124,27 @@ // Pause request stream

// Build proxy
var proxy = new httpProxy.HttpProxy({
target: _.clone(backend)
});
// Apply middleware
return self.applyMiddleware(resource, req, null)
.then(function() {
console.log('handledWs: ', backend.host+req.url);
// Actual proxying
proxy.proxyWebSocketRequest(req, socket, head);
// Build proxy
var proxy = new httpProxy.HttpProxy({
target: _.clone(backend)
});
// Resume request
req.resume();
// Actual proxying
proxy.proxyWebSocketRequest(req, socket, head);
return backend;
// Resume request
req.resume();
return backend;
});
})
.fail(function(err) {
req.resume();
console.log('WS ERROR =');
console.log(err.stack);
socket.write('ERROR: Loadfire does not know how to handle that request');

@@ -132,0 +151,0 @@ socket.close();

{
"name" : "loadfire",
"version" : "1.2.0",
"version" : "1.3.0",
"description" : "A clean and simple load balancer",

@@ -5,0 +5,0 @@ "keywords": [

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