npm.io
3.4.5 • Published 3 years ago

@spklai/fast-gateway

Licence
MIT
Version
3.4.5
Deps
6
Size
14 kB
Vulns
0
Weekly
0

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

Keywords