portr icon indicating copy to clipboard operation
portr copied to clipboard

[Cloudflare] Subdomain is not created

Open Timmlion opened this issue 1 year ago • 2 comments

When running portr in HTTP mode, I get "Tunnel connected: https://test.example.com -> 🌐 -> localhost:1111," but I can't connect it to my local API. When I look into the DNS > Records tab in the Cloudflare panel, I don't see any new record created for the "test" subdomain.

To Reproduce Steps to reproduce the behavior:

  1. Run portr in Docker
  2. Start client
  3. No connection via defined subdomain

Expected behavior When the client is run, the defined subdomain should be created in Cloudflare, and I could connect to my local resources.

Additional context It's not working in HTTP mode, but it works in TCP mode, so I know that the connection itself is working.

Timmlion avatar May 16 '24 15:05 Timmlion

Is the portr server running locally?

amalshaji avatar May 16 '24 16:05 amalshaji

The server is running on an Azure VM. I've opened ports 80, 443, 8000, 2222, and 30001-40001

Edit: Also I've tested the CF token with a curl command to create subdomain from command line

Timmlion avatar May 16 '24 17:05 Timmlion

Portr doesn't create subdomains on the fly. It uses a wildcard certificate for *.example.com. You need to add DNS A records for @ and * pointing to your server address. This was missing in the docs, I've updated the same. https://portr.dev/server/#prerequisites

amalshaji avatar May 17 '24 02:05 amalshaji

I was missing * record, it works now. Thanks :)

Timmlion avatar May 17 '24 06:05 Timmlion