# no-ip-forward

Rule `sonarjs/no-ip-forward`. Client IP address should not be forwarded to proxies

- Source: sonarjs
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Deprecated: yes
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #2154 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/no-ip-forward` | no | no | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-5759/) |

## Code examples

### Correct: the rule accepts this

```js
var httpProxy = require('http-proxy');

// By default xfwd option is false
httpProxy.createProxyServer({target:'http://localhost:9000'}) // Compliant
  .listen(8000);
```

```js
var express = require('express');

const { createProxyMiddleware } = require('http-proxy-middleware');

const app = express();

// By default xfwd option is false
app.use('/proxy', createProxyMiddleware({ target: 'http://localhost:9000', changeOrigin: true})); // Compliant
app.listen(3000);
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "sonarjs/no-ip-forward": "error",
    },
  },
];
```

## Related rules

- [sonarjs/no-mixed-completion-style](https://lintradar.dev/rules/sonarjs/no-mixed-completion-style.md): Test and hook callbacks should use a single completion style
- [sonarjs/no-incorrect-string-concat](https://lintradar.dev/rules/sonarjs/no-incorrect-string-concat.md): Strings and non-strings should not be added
- [sonarjs/no-inconsistent-returns](https://lintradar.dev/rules/sonarjs/no-inconsistent-returns.md): Functions should use "return" consistently
- [sonarjs/no-nested-incdec](https://lintradar.dev/rules/sonarjs/no-nested-incdec.md): Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression
- [sonarjs/no-implicit-dependencies](https://lintradar.dev/rules/sonarjs/no-implicit-dependencies.md): Dependencies should be explicit
- [sonarjs/no-networkidle-wait](https://lintradar.dev/rules/sonarjs/no-networkidle-wait.md): Playwright "networkidle" waits should not be used

---

Web page: https://lintradar.dev/rules/sonarjs/no-ip-forward. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
