{"id":13780709,"url":"https://github.com/dekelev/feathers-http-distributed","last_synced_at":"2025-07-09T20:32:24.818Z","repository":{"id":42719338,"uuid":"283551570","full_name":"dekelev/feathers-http-distributed","owner":"dekelev","description":"Distribute FeathersJS apps over the network with inter-service communication using HTTP protocol","archived":false,"fork":false,"pushed_at":"2023-03-04T12:03:15.000Z","size":317,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-13T09:58:21.741Z","etag":null,"topics":["distributed","docker","feathers","feathersjs","http","kubernetes","microservices"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dekelev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-07-29T16:41:21.000Z","updated_at":"2024-07-01T06:10:14.000Z","dependencies_parsed_at":"2024-01-17T01:34:07.504Z","dependency_job_id":"432b9d7c-e187-4a0f-a10e-c8084b4b0eb7","html_url":"https://github.com/dekelev/feathers-http-distributed","commit_stats":{"total_commits":118,"total_committers":3,"mean_commits":"39.333333333333336","dds":"0.11864406779661019","last_synced_commit":"683cdfffb4ef59f4bb0467784450714c298848e4"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/dekelev/feathers-http-distributed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekelev%2Ffeathers-http-distributed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekelev%2Ffeathers-http-distributed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekelev%2Ffeathers-http-distributed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekelev%2Ffeathers-http-distributed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dekelev","download_url":"https://codeload.github.com/dekelev/feathers-http-distributed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekelev%2Ffeathers-http-distributed/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502652,"owners_count":23618666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distributed","docker","feathers","feathersjs","http","kubernetes","microservices"],"created_at":"2024-08-03T18:01:18.965Z","updated_at":"2025-07-09T20:32:24.792Z","avatar_url":"https://github.com/dekelev.png","language":"JavaScript","readme":"# feathers-http-distributed\n\n[![Build Status](https://travis-ci.org/dekelev/feathers-http-distributed.svg?branch=master)](https://travis-ci.org/dekelev/feathers-http-distributed)\n[![Coverage Status](https://coveralls.io/repos/github/dekelev/feathers-http-distributed/badge.svg?branch=master)](https://coveralls.io/github/dekelev/feathers-http-distributed?branch=master)\n[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/standard/semistandard)\n[![Dependency Status](https://img.shields.io/david/dekelev/feathers-http-distributed.svg)](https://david-dm.org/dekelev/feathers-http-distributed)\n[![npm](https://img.shields.io/npm/v/feathers-http-distributed.svg?maxAge=3600)](https://www.npmjs.com/package/feathers-http-distributed)\n\nDistribute FeathersJS apps over the network with inter-service communication using HTTP protocol.\n\n### Install\n\n```bash\nnpm install --save feathers-http-distributed\n```\n\n### Init\n\n```js\nconst feathers = require('@feathersjs/feathers');\nconst distributed = require('feathers-http-distributed');\n\nconst app = feathers();\n\napp.configure(distributed({}));\n```\n\n##### Options\n\n| Option | Type | Default | Required | Description |\n| --- |:---: | :---: | :---: | --- |\n| protocol | string | `'http'` | no | Protocol to use when calling remote services.\u003cbr/\u003e\u003cbr/\u003eSupported protocols are `http` \u0026 `https`. |\n| host | string | `null` | no | Default hostname to use when calling remote services. |\n| port | number | `80` | no | Port number to use when calling remote services.\u003cbr/\u003e\u003cbr/\u003eDefaults to the default port of the selected protocol. |\n| dnsSuffix | string | `''` | no | DNS suffix that will be added to the `host` when calling remote services. |\n| pathToHost | boolean\u003cbr/\u003efunction | `false` | no | If `host` is not set, path will be converted into `host` by replacing all the non-alphanumeric characters to `-`.\u003cbr/\u003e\u003cbr/\u003eCan also be set with a custom method that receives a path and returns a `host`. |\n| timeout | number | `0` | no | Request timeout in milliseconds.\u003cbr/\u003e\u003cbr/\u003eSet to `0` to disable timeout.\u003cbr/\u003e\u003cbr/\u003eIf timeout is enabled, by default, it will include the time spent on retries. |\n| proxy | object | `null` | no | Transparent HTTP proxy to forward requests to remote services.\u003cbr/\u003e\u003cbr/\u003eSet the `proxy` object with `host` \u0026 `port`.\u003cbr/\u003e\u003cbr/\u003eIf proxy authentication is required, set the `auth` key with object containing the `username` \u0026 `password` keys. |\n| excludeParams | string[] | `null` | no | List of keys to exclude from the `params` object of the remote service call before sending the request. |\n| maxRedirects | number | `5` | no | Maximum redirects to follow.\u003cbr/\u003e\u003cbr/\u003eSet to `0` to disable redirects. |\n| keepAlive | boolean | `false` | no | Use HTTP persistent connections with HTTP keep-alive. |\n| internalRequestHeader | string | `X-Internal-Request` | no | Name of the request header that is sent with each request to remote service.\u003cbr/\u003e\u003cbr/\u003eThis header is used to identify the request as internal and contains the `params` object of the service call.\u003cbr/\u003e\u003cbr/\u003e**Add rule in your external API Gateway or load-balancer to remove this header from all incoming requests.** |\n| retry | boolean\u003cbr/\u003eobject | `false` | no | Retry failed requests on a network error or when receiving 5xx error on an idempotent request (GET, HEAD, OPTIONS, PUT or DELETE).\u003cbr/\u003e\u003cbr/\u003eBy default, it will retry failed requests 3 times without delay.\u003cbr/\u003e\u003cbr/\u003eList of all the supported retry options is available [here](https://www.npmjs.com/package/axios-retry#options). |\n\n### Call remote service\n\n```js\nconst result = await app.service('remote').find({});\n\nconst result = await app.service('remote').find({ host: 'remote-app' });\n```\n\n##### Params\n\n| Option | Type | Required | Description |\n| --- | :---: | :---: | --- |\n| protocol | string | no | Overrides the `protocol` init option. |\n| host | string | no | Overrides the `host` and `pathToHost` init options. |\n| port | number | no | Overrides the `port` init option. |\n| dnsSuffix | string | no | Overrides the `dnsSuffix` init option. |\n| timeout | number | no | Overrides the `timeout` init option. |\n| proxy | object | no | Overrides the `proxy` init option. |\n\n### Middleware\n\nUse the `handleInternalRequest` method to detect and handle incoming HTTP requests from remote FeathersJS apps.\n  \nWhen `handleInternalRequest` returns `true`, skip any further custom middlewares that should only apply to external HTTP requests.\n\n```js\nconst { handleInternalRequest } = require('feathers-http-distributed');\n\napp.use((req, res, next) =\u003e {\n  if (handleInternalRequest(req)) {\n    next();\n\n    return;\n  }\n\n  // Add here custom middlewares that only applies to external HTTP requests\n});\n```\n\n### Security\n\nSecure 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.\n\n### Debug logs\n\nDebug logs can be enabled by settings the `DEBUG` environment variable to `feathers-http-distributed*,axios`.\n\n### Debugging in Kubernetes\n\nThe `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.\n\nTools like [Telepresence](https://www.telepresence.io/) 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.\n\nWith the `proxy` option set, you can simply run [Telepresence](https://www.telepresence.io/) with the [`inject-tcp` proxying method](https://www.telepresence.io/reference/methods.html) and debug your FeathersJS app as you normally do.\n\nSee [here](https://github.com/dekelev/kong-transparent-proxy) for example of deploying transparent HTTP proxy with Docker.\n","funding_links":[],"categories":["Plugins"],"sub_categories":["Scaling"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdekelev%2Ffeathers-http-distributed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdekelev%2Ffeathers-http-distributed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdekelev%2Ffeathers-http-distributed/lists"}