Issue with Cloudflared Tunnels and Go

I currently have a lot of next.js applications already deployed to railway that use cloudflare tunnels and the internal hostname of the railway container.
I'm having an issue when trying to deploy a container with Go. I've tried setting the hostname to the internal container, but my site is not reachable. I'm wondering if anyone else has successfully deployed a go application to railway with cloudflare tunnels. I think it may be related to my scratch container in that maybe scratch can't resolve the DNS hostname due to missing binaries on the machine?
15 Replies
celebrations
celebrations2mo ago
Are you using docker?
Brody
Brody2mo ago
For Go apps you would want to listen to a blank hostname, aka :$PORT As that will listen on IPv6 and IPv4, IPv6 is needed because the private network is IPv6 only.
Web Dev Cody
Web Dev Cody2mo ago
No description
Web Dev Cody
Web Dev Cody2mo ago
so I'm using this I've tried a lot of this @Brody
Web Dev Cody
Web Dev Cody2mo ago
No description
Web Dev Cody
Web Dev Cody2mo ago
I'm trying to configure my fiber server to use tcp6 when deployed to railway since it seems like the hostname doesn't resolve unless it's ip6? the app works fine directly, the issue is with the cloudflared tunnel
celebrations
celebrations2mo ago
is this what you're trying to host?
No description
Web Dev Cody
Web Dev Cody2mo ago
No description
Web Dev Cody
Web Dev Cody2mo ago
oh shit it just worked
celebrations
celebrations2mo ago
it was probably a cache issue
Web Dev Cody
Web Dev Cody2mo ago
ehh idk, the moment I switched to this it seemed to work
No description
Web Dev Cody
Web Dev Cody2mo ago
I was also trying to resolve hostnames inside the container and it seems like ipv4 wasn't supported? like the internal hostname railway provides is ipv6 only
Web Dev Cody
Web Dev Cody2mo ago
No description
Web Dev Cody
Web Dev Cody2mo ago
oh I also added this I'll keep playing around, but I think it's good now
Brody
Brody2mo ago
Correct, it is IPv6 only
Want results from more Discord servers?
Add your server