npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

feathers-http-distributed

v1.1.0

Published

Distribute FeathersJS apps over the network with inter-service communication using HTTP protocol

Readme

feathers-http-distributed

Build Status Coverage Status js-semistandard-style Dependency Status npm

Distribute FeathersJS apps over the network with inter-service communication using HTTP protocol.

Install

npm install --save feathers-http-distributed

Init

const feathers = require('@feathersjs/feathers');
const distributed = require('feathers-http-distributed');

const app = feathers();

app.configure(distributed({}));
Options

| Option | Type | Default | Required | Description | | --- |:---: | :---: | :---: | --- | | protocol | string | 'http' | no | Protocol to use when calling remote services.Supported protocols are http & https. | | host | string | null | no | Default hostname to use when calling remote services. | | port | number | 80 | no | Port number to use when calling remote services.Defaults to the default port of the selected protocol. | | dnsSuffix | string | '' | no | DNS suffix that will be added to the host when calling remote services. | | pathToHost | booleanfunction | false | no | If host is not set, path will be converted into host by replacing all the non-alphanumeric characters to -.Can also be set with a custom method that receives a path and returns a host. | | timeout | number | 0 | no | Request timeout in milliseconds.Set to 0 to disable timeout.If timeout is enabled, by default, it will include the time spent on retries. | | proxy | object | null | no | Transparent HTTP proxy to forward requests to remote services.Set the proxy object with host & port.If proxy authentication is required, set the auth key with object containing the username & password keys. | | excludeParams | string[] | null | no | List of keys to exclude from the params object of the remote service call before sending the request. | | maxRedirects | number | 5 | no | Maximum redirects to follow.Set to 0 to disable redirects. | | keepAlive | boolean | false | no | Use HTTP persistent connections with HTTP keep-alive. | | internalRequestHeader | string | X-Internal-Request | no | Name of the request header that is sent with each request to remote service.This header is used to identify the request as internal and contains the params object of the service call.Add rule in your external API Gateway or load-balancer to remove this header from all incoming requests. | | retry | booleanobject | false | no | Retry failed requests on a network error or when receiving 5xx error on an idempotent request (GET, HEAD, OPTIONS, PUT or DELETE).By default, it will retry failed requests 3 times without delay.List of all the supported retry options is available here. |

Call remote service

const result = await app.service('remote').find({});

const result = await app.service('remote').find({ host: 'remote-app' });
Params

| Option | Type | Required | Description | | --- | :---: | :---: | --- | | protocol | string | no | Overrides the protocol init option. | | host | string | no | Overrides the host and pathToHost init options. | | port | number | no | Overrides the port init option. | | dnsSuffix | string | no | Overrides the dnsSuffix init option. | | timeout | number | no | Overrides the timeout init option. | | proxy | object | no | Overrides the proxy init option. |

Middleware

Use the handleInternalRequest method to detect and handle incoming HTTP requests from remote FeathersJS apps.

When handleInternalRequest returns true, skip any further custom middlewares that should only apply to external HTTP requests.

const { handleInternalRequest } = require('feathers-http-distributed');

app.use((req, res, next) => {
  if (handleInternalRequest(req)) {
    next();

    return;
  }

  // Add here custom middlewares that only applies to external HTTP requests
});

Security

Secure your network by adding a rule in your external API Gateway or load-balancer to remove the X-Internal-Request request header from all the incoming requests.

Debug logs

Debug logs can be enabled by settings the DEBUG environment variable to feathers-http-distributed*,axios.

Debugging in Kubernetes

The proxy option can be used to forward requests from a FeathersJS app running locally to remote services inside Kubernetes clusters with the help of transparent HTTP proxies.

Tools like Telepresence helps with debugging incoming traffic that goes into Kubernetes pods, by swapping the pods with proxy pods and redirects incoming traffic to a local port on the host.

With the proxy option set, you can simply run Telepresence with the inject-tcp proxying method and debug your FeathersJS app as you normally do.

See here for example of deploying transparent HTTP proxy with Docker.