@spklai/fast-gateway
TypeScript icon, indicating that this package has built-in type declarations

3.4.5 • Public • Published

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:

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

Package Sidebar

Install

npm i @spklai/fast-gateway

Weekly Downloads

0

Version

3.4.5

License

MIT

Unpacked Size

14.3 kB

Total Files

9

Last publish

Collaborators

  • dizy