Skip to main content

Development tunnel

Riseact loads your application in an iframe of its panel, but its servers cannot reach your localhost. riseact app dev opens a tunnel to the Riseact infrastructure and gives you a public HTTPS URL that forwards requests to your local server. No external account is needed: earlier versions of the CLI required ngrok.

The URL is stable​

The development address looks like this:

https://d3f2c1a9b8e7d6c5b4a3f2e1d0.tun.riseact.org

The subdomain is derived from the application's credentials, so it is always the same: you do not have to update it on every restart and OAuth redirect_uri values stay valid. The CLI updates the URL registered on Riseact once the tunnel is ready.

Each application has its own subdomain and no other can take it: Riseact authorizes every tunnel with the application's credentials.

The first run is slower​

On the first tunnel of a new application the HTTPS certificate is issued on the spot. It takes a few seconds and the CLI says so:

Preparing the HTTPS certificate, this happens once per app...

The URL is printed only once the certificate is ready, so it works straight away. From the second run this step is instant.

What goes through the tunnel​

All HTTP traffic to the local server, WebSockets included: the SDK's hot reload works through the tunnel too.

The local port​

Between tunnel and server there is a local proxy that merges the application server and the hot reload WebSocket into a single origin. Its port is picked from the free ones on every run, so you can keep several projects open at once.

You normally work on the public URL and the port does not concern you. But if something outside the CLI has to reach the proxy at a fixed address, for example a mobile app under development on the same network with the address baked in, pin the port:

$ riseact app dev --port 43695

If the port is taken the CLI stops, rather than picking another one.

The proxy accepts connections from the whole local network, not only from localhost: keep it in mind on networks you do not control.

Stopping the tunnel​

Ctrl+C closes the tunnel and the development server. The subdomain is released immediately, so you can restart without waiting. With the tunnel down, the URL shows a page telling you to run riseact app dev.

If something goes wrong​

"start error: invalid application credentials"

client_id or client_secret in the project's .env does not match what is registered on Riseact, for example because the application was recreated or its credentials regenerated. Run riseact app init again in the project folder.

"start error: subdomain does not belong to this application"

The subdomain does not match the credentials. Usually .env was edited by hand, mixing credentials from different applications.

"router config conflict"

Another riseact app dev is already running for the same application, perhaps in another terminal. Close it and try again.

The iframe shows "The dev server is not answering yet"

The local server has not finished starting. Wait a few seconds and reload; if it persists, check in the terminal that the server came up on the expected port.

A certificate error in the browser

You opened the URL before starting the tunnel: the certificate is only issued once a tunnel is up. Start riseact app dev and try again; if you had already retried many times, wait a few minutes.

For other problems, attach the tunnel log, ~/.config/riseact-tunnel.log, when you contact support.