Skip to content

preview links dont work for localhost ports #1973

Open
@lukeed

Description

@lukeed

Describe the bug

For a localhost port, Daytona serves a 502 Bad Gateway error indefinitely while polling. Can confirm that the port is up and running (via netstat or ss -lt).

Image

This continues indefinitely until the server is exposed to the network (eg 0.0.0.0). When this happens, I now get a vite error saying that the incoming *.daytona.work domain isnt allowed to access the dev server.

Blocked request. This host ("[id].[hash].daytona.work") is not allowed.
To allow this host, add "[id].[hash].daytona.work" to `server.allowedHosts` in vite.config.js.

To Reproduce
Steps to reproduce the behavior:

  1. Create a workspace with any vite starter app
  2. yarn dev inside workspace
  3. Get preview link for 5173 -> 502 error
  4. run yarn dev --host to expose over network
  5. Get preview link for 5173 -> 403 error

Expected behavior
Preview link(s) for a target port should be working regardless of interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions