smee-client icon indicating copy to clipboard operation
smee-client copied to clipboard

Support for "Virtual host" used by Kubernetes Ingress

Open pawelbolonek opened this issue 4 years ago • 3 comments

Currently client pases original "Host" header coming from request. This way kubernetes ingress can't dispatch call to respective service.

Host header should come from target hostname and original Host could be placed in x-forwarded-host header as proxy usually do.

Suggested solution:

L50: Object.keys(data).forEach(key => { req.set(key, data[key]) if(key.toUpperCase() === 'HOST'){ req.set(key, target.host); req.set('x-forwarded-host', data[key]); } })

pawelbolonek avatar Nov 03 '20 08:11 pawelbolonek

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

stale[bot] avatar May 10 '21 18:05 stale[bot]

Is there an alternative to smee that support this then? if smee won't fix this? I have the same issue. and I think if you have a VM running http server with virtual hosts the proxy won't work as expected... smee should provide this or a way to override the HOST header sent to the target host

mhermosi avatar Dec 05 '22 16:12 mhermosi

Currently client pases original "Host" header coming from request. This way kubernetes ingress can't dispatch call to respective service.

Host header should come from target hostname and original Host could be placed in x-forwarded-host header as proxy usually do.

Suggested solution:

L50: Object.keys(data).forEach(key => { req.set(key, data[key]) if(key.toUpperCase() === 'HOST'){ req.set(key, target.host); req.set('x-forwarded-host', data[key]); } })

I have tried this on my computer and works! Why not put the change and make a PR to see if it is accepted.... it is annoying having to have a customized version of smee!

mhermosi avatar Dec 05 '22 16:12 mhermosi