Forwarding hostname

Hello!

I’ve been using ngrok to expose my local sites for testing on mobile and VMs, and since local servers only respond to a specific hostname, I’ve always been using the host-header argument to send a specific hostname from ngrok to my server so it hits the correct site.

Is there a way with argo tunnels to forward/spoof the host header ?

Cheers!

1 Like

Never tried, but as far as I know the host header arrives as a part for the normal request as it is required to connect to Cloudflare at all.

Yes but the original hostname of the site, ie example.com, is not necessarily sent to the origin server using any of the current cli arguments.

This makes it hard to use in a server environment that serves more than one site.

ngrok for example enables this via the ‘hostname’ argument.

I believe it does send it, I had today set up a web server accepting only localhost and once I connected via Argo it replied that that domain didn’t exist on the server.

Unfortunately it does not.

So using the free version ( no login, auth, etc ):

  • I create a new index.php file with just var_dump( $_SERVER ); to inspect server variables on requests
  • I run php server using php -S localhost
  • I setup an argo tunnel using Cloudflared tunnel --url local.local where local.local is mapped to 127.0.0.1
  • I hit the tunnel URL
  • I get this ["HTTP_HOST"] => string(46) "comp-logo-developing-extreme.tryCloudflare.com" instead of the expected local.local hostname.
    ( see full version here: https://gist.github.com/shadyvb/d69fa33bd3e38eac9b32bbf0735cb0ad )

Am I doing something wrong ?

Oh I see, you are using the free version. That doesn’t support custom domains. That will work with that domain only, hence it won’t proxy the host otherwise things could break.

1 Like

Is there a way to request this feature in the free version ?, I can imagine that’s a limiting factor for a good percentage of people.

The free was never expected to be used for production. It’s for simply testing things. You need to pay for using it. Otherwise why would you pay 10c/GB? They need to earn their investment back.

1 Like

I didn’t say I’d use this for production, so this doesn’t answer the question. But thanks for the insight and the follow up!

Yeah, but how can they decide if you are using it for production? They can only limit the ability to use it on a custom domain (the same ngrok does basically).

Yeah, I see your point, but there are other ways to do that, throttling, time limits, usage limits, etc.

Agreed, but they do not want to do that, they want you to experience the whole potential of Argo.