{"id":23098935,"url":"https://github.com/digitalcortex/feathers-express-ip","last_synced_at":"2025-08-16T12:33:55.162Z","repository":{"id":42663380,"uuid":"270405695","full_name":"digitalcortex/feathers-express-ip","owner":"digitalcortex","description":"Expose requester's IP address to your Feathers services","archived":false,"fork":false,"pushed_at":"2022-12-14T01:17:52.000Z","size":177,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-12T14:48:31.461Z","etag":null,"topics":["express-js","feathers","feathers-js"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/digitalcortex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-07T19:10:51.000Z","updated_at":"2023-07-10T15:06:16.000Z","dependencies_parsed_at":"2023-01-28T16:15:29.341Z","dependency_job_id":null,"html_url":"https://github.com/digitalcortex/feathers-express-ip","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalcortex%2Ffeathers-express-ip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalcortex%2Ffeathers-express-ip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalcortex%2Ffeathers-express-ip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalcortex%2Ffeathers-express-ip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalcortex","download_url":"https://codeload.github.com/digitalcortex/feathers-express-ip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229910997,"owners_count":18143229,"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":["express-js","feathers","feathers-js"],"created_at":"2024-12-16T23:15:25.489Z","updated_at":"2024-12-16T23:15:26.212Z","avatar_url":"https://github.com/digitalcortex.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Expose requester's IP address to your Feathers services\n\nWith feathers-express-ip you can make your own solution for:\n- Rate limiting per IP address\n- Tracing the request by IP\n\n## Installation\n```\nnpm install feathers-express-ip --save\n```\n\n```\nyarn add feathers-express-ip\n```\n\n## Example usage\nImport package\n```typescript\n// Typescript\nimport { feathersIp, feathersIpSocketIO } from 'feathers-express-ip';\n\n// Javascript\nconst { feathersIp, feathersIpSocketIO } = require('feathers-express-ip');\n```\n\nFor working with socket connections:\n```typescript\n// Replace following line in src/app.ts:\napp.configure(socketio());\n\n// With following code:\napp.configure(socketio(function (io) {\n  feathersIpSocketIO(io, 'ip');\n}));\n```\n\nFor working with standard HTTP requests:\n```typescript\n// After following line in src/app.ts:\napp.configure(express.rest());\n\n// Add following line:\napp.use(feathersIp('ip'));\n```\n\nRead provided IP address in Feathers hook:\n```typescript\n(context: HookContext) =\u003e {\n  console.log(context.params.ip);\n}\n```\n\n## Using with reverse proxy\nReverse proxies not only hide IP address of your app from the user, they also hide the user's IP address from the app.\nIf you want to get user's IP address while using reverse proxy such as Nginx, you will need configure your Nginx server accordingly.\n\n[Read explanation on Nginx website](https://www.nginx.com/resources/wiki/start/topics/examples/forwarded/)\n\nIn short, you can add following code in your Nginx config to set the headers:\n```\nproxy_pass_header  Set-Cookie;\n\nproxy_set_header   Host               $host;\nproxy_set_header   X-Real-IP          $remote_addr;\nproxy_set_header   X-Forwarded-Proto  $scheme;\nproxy_set_header   X-Forwarded-For    $proxy_add_x_forwarded_for;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalcortex%2Ffeathers-express-ip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalcortex%2Ffeathers-express-ip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalcortex%2Ffeathers-express-ip/lists"}