buslane
buslane is a cross-service and transparent object.method proxy, using an rpc-lite json/http2 transport.
Last updated 2 years ago by seektheerror .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install buslane 
SYNC missed versions from official npm registry.

Buslane

Greenkeeper badge Coverage Status

Intro

buslane is a cross-service and transparent object.method proxy, using an rpc-lite json/http2 transport.

The need for this lib came about when we decided to move to docker at 5app. I wanted a simple way to remove our direct code dependencies between services without having to add extra endpoints manually.

With buslane and its RPC like object proxying, you can call methods on remote objects as if they were in the same context. So there is no need to create specific service endpoints either. Just write the configuration and buslane will expose the objects to each other.

This is all still very experimental, so use with caution, I sure am.

Config & Usage

Warning: This lib can only work if the --expose-http2 is passed to the node process at start time.

I recommend looking at the tests to understand how the initialization work.

Test

build and run with docker:

docker build -t buslane . && docker run buslane

SSL

By default buslane only provide a self signed cert that will only work with localhost. This default certificate is not for production use.

To generate the ssl certs for a particular host(the one your service will run on, make sure you replace $HOST and $NUMBER_OF_VALID_DAYS of course):

openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj -days $NUMBER_OF_VALID_DAYS'/CN=$HOST' -keyout ssl/key.pem -out ssl/certificate.pem

Then make sure you provision the service with the absolute path to the key and the certificate:

const config = {name, shared_api_key: 'test'};
	config.map = [
		{name: 'argo', port: 11211, ingresses: ['boat'], ssl_key_path, ssl_cert_path},
		{name: 'jason', port: 11311, ingresses: []},
	];

Current Tags

  • 2.2.0                                ...           latest (2 years ago)

4 Versions

  • 2.2.0                                ...           2 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 4
Last Day 0
Last Week 0
Last Month 3
Dependencies (0)
None
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |