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

biws

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

biws

seaport aware load balancing http request client

  • 0.0.7
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-82.35%
Maintainers
1
Weekly downloads
 
Created
Source

This a layer on top of the builtin http.request and mikeals's request to handle load balancing etc. Most of the defaults apply.

_ While in pre 1.0.0 release just assume every version breaks things :-) _

Usage

var opts = {
    servers : [
        { protocol: 'http', host: 'localhost', port: 8000},
        { protocol: 'http', host: 'localhost', port: 8001}
    ]
}

var myServiceClient = biws.createClient(opts);

var someRequest = myServiceClient.request('/index', mycallback);

someRequest.end();



NOTES

Clients have a LoadBalancer LoadBalancers have a Rule (like round robin or round robin) When a request gets made the loadbalancer gets a server from the serverList using a rule Rules get passed a ServerList to pick from and return a server.

A valid 'ServerList' is any object with a 'getServers' method that return an array of 'Server'

TODO

Write some unit tests.....

  • Making requests before SeaportServerList has synced will fail. You can listen to SeaportServerList.port.on('synced') but that is derp...

  • HttpClient should just be a client and hide away HTTP/HTTPS/SPDY underneath.

  • Agent can probably handle this abstraction fun for us (and connection priming)

  • Add in metrics.

  • Create a AWS AZ aware load balancer.

  • Abstract out dynamic/servie-discovery aware ServiceLists somehow.

  • Prime / prewarming connections

  • Healthchecks?

  • Make alot of things configurable [tls options!]

The seaport server list is too strongly tied to seaport, seaport goes down, everything goes down... Maybe we should cache the list, or make the serverList updater a seperate module...

FAQs

Package last updated on 13 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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