Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
nest-request-ip
Advanced tools
Readme
Nest Request IP is a convenient Nest.js module that allows you to effortlessly retrieve information from HTTP requests, including client IP addresses, user agents, browsers, and operating systems. With this module, you can enhance your Nest.js application's functionality by gaining insights into the characteristics of incoming requests.
city
, country
, region
, timezone
from IPnpm install nest-request-ip --save
app.module.ts
import { Module } from "@nestjs/common";
import { RequestIpModule } from "nest-request-ip";
import { AppController } from "./app.controller";
import { AppService } from "./app.service";
@Module({
imports: [
RequestIpModule.forRoot({
localIpAddress: "76.76.21.123", // this ip is used when the request is local
}),
],
controllers: [AppController],
})
export class AppModule {}
app.controller.ts
import { Controller, Get, Req } from "@nestjs/common";
import { Request } from "express";
import {
GetClientIp,
GetClientAgent,
GetClientBrowser,
GetClientSystem,
} from "nest-request-ip";
@Controller()
export class AppController {
@Get()
getHello(@GetClientIp() ip: ClientInfo) {
return ip;
}
@Get("agent")
getAgent(@GetClientAgent() agent: string) {
return agent;
}
@Get("browser")
getBrowser(@GetClientBrowser() browser: string) {
return browser;
}
@Get("system")
getSystem(@GetClientSystem() system: string) {
return system;
}
}
FAQs
Nest Request IP is a convenient Nest.js module that allows you to effortlessly retrieve information from HTTP requests, including client IP addresses, user agents, browsers, and operating systems. With this module, you can enhance your Nest.js application
The npm package nest-request-ip receives a total of 50 weekly downloads. As such, nest-request-ip popularity was classified as not popular.
We found that nest-request-ip demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.