Port Forwarding and Network Access¶
Velda provides several methods to connect to open ports from running services and workloads.
1. Use Session Name as Hostname¶
The simplest way is to use the session name directly as the hostname. This works when connecting from another session on the same instance.
The service must allow connection from external address.
# Start a web server in a session
vrun -s web python -m http.server 8000 &
# Access from another session
curl web:8000
2. Port-Forward While Running Workload¶
Forward a port while launching your workload, making it accessible via localhost within the instance:
# Forward port and run service
vrun -p 8000:8000 python -m http.server 8000 &
# Access via localhost
curl localhost:8000
3. Port-Forward for Browser or Remote Access¶
Enable access from your local machine to services running in Velda:
Step 1: Start your workload in a session
Step 2: From your local machine (requires Velda CLI)
After running this command, access the service at http://localhost:8000 in your local browser.
4. Use Proxy (Velda Cloud / Enterprise only)¶
Most Velda deployments include a proxy server for easy HTTP/HTTPS access.
If your workload runs as:
And your Velda service is hosted at velda.example.com, access it at:
Note: For endpoint security, this option is currently only available with enterprise/velda.cloud.
5. Use VS Code (or Your IDE) Port Forwarding¶
If you're connected via VS Code, you can use its built-in port-forwarding feature:
- Open the Ports panel in VS Code
- Click "Forward a Port"
- Enter the port number (e.g., 8000)
- Access via
localhost:8000on your local machine - Use port-forwarding with
vrunto forward ports from other sessions.
Best Practices¶
1. Use Named Sessions for Important Workloads¶
# Good: Named session for easy reattachment
vrun -s my-training python train.py
# Less ideal: Anonymous session
vrun python train.py
2. Match Resource Pool to Workload¶
# Good: GPU pool for GPU workload
vrun -P gpu-a100 python train.py
# Wasteful: GPU pool for CPU-only workload
vrun -P gpu-a100 python preprocess.py # Should use cpu-large