# pw endpoints http

> Source: https://parallelworks.com/docs/cli/pw/endpoints/http

## pw endpoints http

Serve a local HTTP app as an endpoint

### Synopsis

Serve a local app through the platform: the CLI dials out and registers a
reverse tunnel, then forwards the session URL to your app until you exit.

Local dev servers (Next.js, Vite, etc.) see requests arriving from the public
endpoint host rather than localhost, so their Hot Module Reload socket and
dev-only routes are treated as cross-origin and may be blocked — the page loads
but never finishes updating and the browser console shows repeated HMR WebSocket
failures. Allow the endpoint host in your dev server's config to fix it (Next.js
**allowedDevOrigins**, Vite **server.allowedHosts**).

Add **--openai** to expose a local OpenAI-compatible server (a /v1 endpoint such
as vLLM or Ollama) as a model in the platform chat and AI providers. Use
**--auth-file** if that server requires an API key.

```
pw endpoints http (PORT | SOCKET_PATH) [flags]
```

### Examples

```
  # Serve a local app on port 5173 as an endpoint
  pw endpoints http 5173
  
  # Serve a local app listening on a Unix socket
  pw endpoints http /tmp/app.sock
  
  # Give it a name and open it in the browser
  pw endpoints http --name my_app --open 3000
  
  # Serve it publicly so anyone with the link can reach it without logging in
  pw endpoints http --public 3000
  
  # Expose a local OpenAI-compatible server (e.g. Ollama) as a chat model
  pw endpoints http --openai --name my_llm 11434
```

### Options

```
      --auth-file string                    File containing an Authorization header value or token to forward to the local app
      --auth-scheme string                  Authorization scheme used when --auth-file contains only a raw token (default "Bearer")
      --description string                  Session description (defaults to "Endpoint on <hostname>")
  -h, --help                                help for http
      --keep                                Keep the endpoint session on exit instead of deleting it
      --link                                Stop the local server process listening on the target port when this command exits
  -n, --name string                         Name for the endpoint session (defaults to a server-generated name)
      --no-subdomain                        Skip subdomain assignment and use the path-based session URL
      --open                                Open the endpoint URL in the browser
      --openai                              Expose this endpoint as an OpenAI-compatible model in the platform chat and AI providers. Point it at a local /v1 server (vLLM, Ollama, etc.); pass --auth-file if that server needs an API key.
  -o, --output string                       Output format (interactive, text); interactive shows a live dashboard and downgrades to text when stdout is not a terminal (default "interactive")
      --public                              Make the endpoint publicly accessible: anyone with the link can reach it without logging in. Requires your organization to allow public sessions.
      --rewrite-host string[="localhost"]   Rewrite the Host header sent to your local app to this value (defaults to "localhost" when the flag is given without one). Use for an app that rejects the public endpoint host, such as a DNS-rebinding guard or an allowed-hosts check.
      --slug string                         Session base-path slug (default "/")
      --strip-path                          Strip the session URL prefix before forwarding to your app (use only if your app serves at the root path and can't be configured with a base path; by default the full path is forwarded so set your app's base path to the endpoint URL)
  -s, --subdomain string                    Serve at this subdomain: a label (my-app), which lands on the platform's default sessions domain, or the full host under any registered sessions domain (my-app.<sessions domain>); a random subdomain is used by default when the platform supports them
```

### Options inherited from parent commands

```
      --context string         The context to use. Overrides PW_CONTEXT environment variable and current context from config.
      --platform-host string   The Parallel Works ACTIVATE platform host to use. Will override any other platform host settings.
  -v, --verbose                Enable verbose logging
```

### SEE ALSO

* [pw endpoints](/docs/cli/pw/endpoints)	 - Create and serve self-registering endpoint sessions
