Skip to main content

Method signature

Parameters

Return value

Examples

Get Host for Web Server

Get Host for API Server

Get Host for Database Connection

Error handling

The method throws errors in the following cases:
  • Sandbox not active: When called without an active sandbox environment
  • Unsupported sandbox: When called with unsupported sandbox environments (FlyIO, Modal)
  • Invalid port: When the port number is invalid or out of range

Sandbox compatibility

Use cases

  • Web Development: Access development servers running in the sandbox
  • API Testing: Get URLs for API servers to test endpoints
  • Database Access: Connect to databases running in the sandbox
  • Microservices: Access multiple services running on different ports
  • Live Previews: Generate URLs for real-time preview of web applications

Notes

  • Multi-Sandbox Support: This method is available for E2B, Daytona, Cloudflare and Northflank sandbox environments
  • Automatic URL Generation: Supported sandboxes automatically generate secure HTTPS URLs for exposed ports
  • Real-time Access: URLs are immediately accessible once the service starts on the specified port
  • Security: All generated URLs use HTTPS and are scoped to the specific sandbox instance
  • Port Range: Standard port ranges (1-65535) are supported
  • No Port Validation: The method doesn’t validate if a service is actually running on the specified port