Using ngrok with Vuer
ngrok is a popular tunneling service that can expose your local server with SSL/TLS encryption.
Installation
For Mac users:
For other platforms, see the official ngrok installation guide.
After installation, you'll need to sign up for a free account at ngrok.com and authenticate:
Free Tier (No Subscription Required)
The ngrok free tier works perfectly for WebXR development. Simply start ngrok with:
You should see output like:
Note: The URL will be randomly generated and will change each time you restart ngrok.
This successfully promotes your local vuer server from ws://localhost:8012 to wss://1a2b-3c4d-5e6f.ngrok-free.app (note the double wss in the protocol).
Connecting to Your Vuer Server (Free Tier)
Once ngrok is running, use the randomly generated URL to connect:
Note: If you change the Vuer port (e.g., app = Vuer(port=3012)), you need to update the ngrok command accordingly:
The connection URL remains the same format, just with the new ngrok-generated domain.
Paid Tier (Personal Subscription - For Custom Subdomains)
If you have a Personal subscription plan, you can use custom subdomains that remain consistent across restarts.
Configuration with Persistent Subdomains
-
Edit the ngrok configuration:
-
Add the following below your
authtoken: -
Start all configured tunnels:
Quick Start with Custom Subdomain
You should see output like:
Connecting to Your Vuer Server (Paid Tier)
Note: If you change the Vuer port (e.g., app = Vuer(port=3012)), you need to update the ngrok command accordingly:
The connection URL remains the same since you're using a custom subdomain.
Connecting a Python Client via ngrok
When connecting a VuerClient to a Vuer server through ngrok (especially TCP tunnels), you may encounter SSL certificate verification errors with self-signed certificates. Use ssl_verify=False to disable verification:
Or set the environment variable: