Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nestjs-real-ip

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-real-ip

A concise decorator for retrieving an IP address from http request with Nest.js controller method

  • 3.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24K
increased by4.33%
Maintainers
1
Weekly downloads
 
Created
Source

Nest.js real ip decorator

A concise decorator for retrieving an IP address from http request with Nest.js controller method.

NPM package link

Installation

# Install the upstream version for projects based on NestJS v8 and above
npm install nestjs-real-ip

# Or use the version 1.0.3 for projects based on NestJS v7
npm install nestjs-real-ip@1.0.3

Example controller

import { RealIP } from 'nestjs-real-ip';

@Controller('/')
class TestController {
  @Get('my-ip')
  get(@RealIP() ip: string): string {
    return ip;
  }
}

Under the hood

Based on the tiny module @supercharge/request-ip. It supports a wide list of request headers and properties to get working in almost any environment. See the request-ip module description for details.

Also, see the decorator's tests.

License

The code is under MIT license. See the LICENSE file for details.

Development

# Update code, commit and push with git
npm version [ major | minor | patch ]
npm publish

Keywords

FAQs

Package last updated on 19 Jun 2023

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