# withTransformXForwarded

- Module: [Aspire.Hosting.Yarp](/reference/api/typescript/aspire.hosting.yarp.md)
- Version: `13.4.0`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire)

Adds the transform which will add X-Forwarded-* headers.

## Definition

```typescript
interface YarpRoute {
  // ... omitted for brevity
  withTransformXForwarded(
    headerPrefix?: string,
    xDefault?: ForwardedTransformActions,
    xFor?: ForwardedTransformActions,
    xHost?: ForwardedTransformActions,
    xProto?: ForwardedTransformActions,
    xPrefix?: ForwardedTransformActions): YarpRoute
}
```

## Parameters

- `headerPrefix` (`string`) `optional` `= X-Forwarded-`
- `xDefault` (`ForwardedTransformActions`) `optional` `= Set`
- `xFor` (`ForwardedTransformActions`) `optional`
- `xHost` (`ForwardedTransformActions`) `optional`
- `xProto` (`ForwardedTransformActions`) `optional`
- `xPrefix` (`ForwardedTransformActions`) `optional`

## Returns

[YarpRoute](/reference/api/typescript/aspire.hosting.yarp/yarproute.md)

## Applies to

- [YarpRoute](/reference/api/typescript/aspire.hosting.yarp/yarproute.md)
