# @spklai/fast-gateway

> A Node.js API Gateway for the masses!

Latest version **3.4.5** (published 2023-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @spklai/fast-gateway
pnpm add @spklai/fast-gateway
yarn add @spklai/fast-gateway
bun add @spklai/fast-gateway
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.4.5 |
| Published | 2023-07-30 |
| First published | 2023-07-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 14 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | SparkleAI |
| Maintainers | dizy |
| Keywords | fast, http, proxy, api, gateway |

## Links

- npm: https://www.npmjs.com/package/@spklai/fast-gateway
- Repository: https://github.com/spklai/fast-gateway
- Homepage: https://github.com/spklai/fast-gateway#readme
- Issues: https://github.com/spklai/fast-gateway/issues
- npm.io page: https://npm.io/package/@spklai/fast-gateway

## Dependencies (6)

- [restana](https://npm.io/package/restana.md) ^4.9.7
- [micromatch](https://npm.io/package/micromatch.md) ^4.0.5
- [fast-proxy-lite](https://npm.io/package/fast-proxy-lite.md) ^1.1.1
- [stream-to-array](https://npm.io/package/stream-to-array.md) ^2.3.0
- [@polka/send-type](https://npm.io/package/@polka/send-type.md) ^0.5.2
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) ^1.4.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 3.4.5 (latest) — 2023-07-30

## README

# Introduction

This is a fork of [fast-gateway]() with added support for forwarding request headers for websocket connections.

## Usage

One additional option in the `WebSocketRoute`:

```ts
interface WebSocketRoute {
  proxyType: 'websocket';
  proxyConfig?: {}; 
  passRequestHeaders?: boolean; // <-- this one, defaults to false
  prefix: string;
  target: string;
  subProtocols?: [];
  hooks?: WebSocketHooks;
}
```

If `passRequestHeaders` is set to `true`, the request headers will be forwarded to the target server. This is useful for downstream authentication purposes.


## More
- fast-gateway's original website and documentation: https://fgw.21no.de

---
_Source: https://npm.io/package/@spklai/fast-gateway · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
