Skip to content

Look into the req.ip field in more depth and determine if it is an adequate way to uniquely identify users. #47

@shalarewicz

Description

@shalarewicz

There are numerous ways to get the IP address off of the request object.

The header x-forward-for will hold the originating IP address if a proxy is placed in front of the server. This would be common for a production build.

  • req.ips wwill hold an array of IP addresses in x-forward-for header. Client is likely at index zero
  • req.ip will have the IP address
  • req.socket.remoteAddress is an instance of net.socket which is used as another method of getting the IP address
  • req.ip and req.ips will work in express but not with other frameworks

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions