NPM / CLI

Run the OpenBotAuth Proxy using npm or npx.

Package: @openbotauth/proxyarrow-up-right

Quick Start

# Run without installing (recommended)
npx @openbotauth/proxy

# Or install globally
npm install -g @openbotauth/proxy
openbotauth-proxy

Requirements: Node.js >= 18.0.0

Installation Methods

npx (No Install)

Run directly without installing:

npx @openbotauth/proxy

Global Install

After global install, run with:

Local Install

Add to your project:

Then run via npm scripts in package.json:

Configuration

All configuration is via environment variables:

Variable
Default
Description

PORT

8088

Proxy listen port

UPSTREAM_URL

http://localhost:8080

Backend server URL

OBA_VERIFIER_URL

https://verifier.openbotauth.org/verify

Verifier service endpoint

OBA_MODE

observe

observe or require-verified

OBA_TIMEOUT_MS

5000

Verifier request timeout (ms)

OBA_PROTECTED_PATHS

/protected

Comma-separated paths requiring verification

Usage Examples

Basic Usage

Proxy requests from port 8088 to localhost:8080:

Custom Backend

Proxy to a different backend:

Custom Port

Run on a different port:

Require Verification

Enforce verification on all paths:

Protected Paths Only

Require verification only on specific paths:

Full Configuration

Process Managers

PM2

systemd

Programmatic Usage

You can also use the proxy programmatically in your Node.js application:

Health Check

Verify the proxy is running:

Response:

Logging

The proxy logs to stdout:

Troubleshooting

Proxy won't start

Check that the port is available:

Verification always fails

  1. Check the verifier URL is accessible

  2. Verify the bot is sending correct RFC 9421 headers

  3. Check clock synchronization (signatures expire)

Timeout errors

Increase the timeout:

Backend not receiving requests

  1. Verify UPSTREAM_URL is correct

  2. Check backend is running and accessible

  3. Test direct connection to backend

Last updated