DocumentationPort forwarding

Remote & collaboration

Port forwarding

Expose a service running on your machine through a secure, shareable TCP forwarding link.

1 min read Dragent guide

Port forwarding is separate from sharing a terminal session. Use it when a local web app, API, preview server, or database needs to be reached remotely. The process continues to run on your computer; Dragent forwards TCP traffic to the local port.

Forward a port

  • Start your local service, for example npm run dev on port 5173.
  • Open the tab's Ports bar and choose Forward port.
  • Enter the local port and copy the generated forwarding URL. Each forwarded port appears in its own row.
  • Open the URL in a browser or send it to someone who needs to view the running service.

How it behaves

The link is a general TCP tunnel, so HTML, JavaScript modules, stylesheets, API requests, WebSockets, and other assets use the same forwarding path. The host header and forwarding headers are preserved so development servers can identify the original public hostname.

Security and troubleshooting

  • Forwarding links are protected by a secret and should be treated like credentials.
  • Keep the local process running while the port is being used; stopping it makes the link unavailable.
  • For Vite, add the forwarding hostname to server.allowedHosts if Vite reports that the host is not allowed.
  • A 502 usually means the local service is not listening, restarted, or is bound to an unreachable interface; check the local URL first.