Parallel Works

pw forward

Forward remote ports to your local machine via SSH tunnels

Synopsis

The pw forward command creates SSH tunnels that make remote ports accessible on your local machine. This uses the same mechanism as the -L option in OpenSSH.

Unlike pw ssh -L, this command automatically reconnects if the SSH connection is interrupted. Local listeners stay open across reconnects, so client programs only see a brief interruption rather than a closed port. This makes it ideal for long-lived tunnels.

Resource names can be specified in the following formats:

  • pw://username/name - full format with explicit username
  • pw://name - managed cluster by name in your organization
  • name - short format where username defaults to your username
pw forward -L [bind_address:]port:host:hostport [-L ...] <resource> [flags]

Examples

  pw forward -L 8080:localhost:8080 my-cluster
  
  # Forward multiple remote ports
  pw forward -L 5900:localhost:5901 -L 3000:localhost:3000 my-cluster
  
  # Bind to all interfaces (accessible from other machines on your network)
  pw forward -L 0.0.0.0:8080:localhost:8080 my-cluster
  
  # Forward a port from your user workspace
  pw forward -L 8080:localhost:8080 workspace

Options

  -h, --help                help for forward
      --keepalive int       Interval in seconds between keepalive messages (0 to disable) (default 30)
  -L, --local stringArray   Forward local [bind_address:]port to remote host:hostport (required, repeatable)

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 - The Parallel Works ACTIVATE CLI