Localhost Access

Localhost Access

Run web servers, APIs, and dashboards inside Lab and access them through a secure proxy.

How It Works

Services running in your Lab environment aren’t directly exposed to the internet. Instead, Calliope provides a secure proxy that lets you access them through your browser.

Authentication Required: Proxy URLs are protected by your Calliope login. Only you (and teammates with Hub access) can access services running in your workspace.

Recommended Ports

Use ports 9000-9999 for your applications. Other ports may be reserved for system services and could conflict with Lab’s internal processes.
Port RangeStatus
9000-9999Recommended for user apps
Other portsMay conflict with system services

Accessing Your Service

If you start a service on port 9000, access it at:

https://your-workspace-url/proxy/9000/

Replace the port number with your actual service port.

Examples

Flask App

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello():
    return 'Hello from Lab!'

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=9000)

Run in terminal: python app.py &

Access at: https://your-workspace-url/proxy/9000/

FastAPI

# main.py
from fastapi import FastAPI
app = FastAPI()

@app.get("/")
def read_root():
    return {"message": "Hello from Lab!"}

Run: uvicorn main:app --host 0.0.0.0 --port 9001 &

Access at: https://your-workspace-url/proxy/9001/

Streamlit Dashboard

streamlit run my_app.py --server.port 9002 --server.headless true &

Access at: https://your-workspace-url/proxy/9002/

Gradio Interface

import gradio as gr

def greet(name):
    return f"Hello {name}!"

demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch(server_name="0.0.0.0", server_port=9003)

Access at: https://your-workspace-url/proxy/9003/

Node.js / Express

const express = require('express');
const app = express();

app.get('/', (req, res) => {
  res.send('Hello from Lab!');
});

app.listen(9004, '0.0.0.0', () => {
  console.log('Server running on port 9004');
});

Access at: https://your-workspace-url/proxy/9004/

Voilà (Notebook Dashboard)

voila my_notebook.ipynb --port 9005 --no-browser --Voila.ip=0.0.0.0 &

Access at: https://your-workspace-url/proxy/9005/

Suggested Port Assignments

Service TypeSuggested Port
Flask / FastAPI9000
Secondary API9001
Streamlit9002
Gradio9003
Node.js9004
Voilà9005
Custom apps9006-9999

Tips

  • Trailing slash: Always include the trailing slash (/proxy/9000/ not /proxy/9000)
  • Bind to 0.0.0.0: Configure your service to bind to 0.0.0.0, not just localhost
  • Relative paths: Use relative URLs in your app for assets and links
  • WebSockets: Supported through the proxy
  • Background processes: Use & to run services in the background

Troubleshooting

Service not accessible?

# Check if service is running
lsof -i :9000

# Check service logs

Connection refused?

  • Ensure your service binds to 0.0.0.0 (not 127.0.0.1)
  • Most frameworks need explicit host configuration:
    • Flask: app.run(host='0.0.0.0')
    • FastAPI: --host 0.0.0.0
    • Streamlit: Uses 0.0.0.0 by default

Assets not loading?

  • Configure your app to use relative URLs
  • Some frameworks need base URL/path configuration for proxied environments