Documentation Index
Fetch the complete documentation index at: https://mintlify.com/outray-tunnel/outray/llms.txt
Use this file to discover all available pages before exploring further.
@outray/core is the foundational package for OutRay. It provides the WebSocket tunnel client, mDNS local-access utilities, and the binary message protocol used between the client and server. The CLI and all official framework plugins are built on top of it.
When to use @outray/core
CLI
Use
outray (the CLI) when you want to start tunnels from the command line without writing code.Framework plugins
Use
@outray/vite or another framework plugin when you want tunnels to start automatically as part of your dev-server setup.@outray/core
Use
@outray/core directly when you are building a framework plugin, a custom integration, or need programmatic control over the tunnel lifecycle.Installation
- npm
- pnpm
- yarn
Quick start
Exports
Classes
OutrayClient
The primary tunnel client. Connects to the OutRay server over WebSocket and proxies HTTP, TCP, and UDP traffic to a local port. See OutrayClient options for the full API.
MDNSAdvertiser
Advertises a service on the local network via mDNS so devices on the same LAN can reach
<name>.local.LocalProxy
HTTP reverse proxy that binds to port 80 on the local machine and forwards requests to a local service port.
LocalHttpsProxy
HTTPS reverse proxy that binds to port 443 on the local machine. Uses a self-signed certificate by default; trusts system certificates if available.
LocalAccessManager
Convenience class that combines
MDNSAdvertiser, LocalProxy, and LocalHttpsProxy for managing full local access.Protocol utilities
| Export | Description |
|---|---|
encodeMessage(msg) | Serialize a ClientMessage or ServerMessage to a string for transmission over the WebSocket. |
decodeMessage(raw) | Parse a raw WebSocket message string into a typed ServerMessage or ClientMessage. |
Exported types
Building a framework plugin
@outray/core is designed to be embedded inside framework-specific wrappers. A minimal plugin looks like this: