microsoft / dev-tunnels

Dev Tunnels SDK
MIT License
286 stars 20 forks source link

Wrong IP address in x-forwarded-for request header #466

Closed mubashir-kwanso closed 1 month ago

mubashir-kwanso commented 1 month ago

I am using devtunnel for chargebee webhook events.

Chargebee has listed the IPs from which they send the webhook event requests.

But somehow I am getting wrong IP in request.ip and request.headers["x-forwarded-for"]. None of these match the IPs listed in Chargebee docs.

If I use ngrok, I get correct IP in request.headers["x-forwarded-for"].

derekbekoe commented 1 month ago

Thanks for taking the time to file this issue. The Dev Tunnels service uses the x-forwarded-for header internally and so the IP address returned will be in the Private Address Space. Therefore, it won't match what you may be expecting for your use-case.

Unfortunately, we’re not able to prioritize changing this due to the other higher-impact issues we receive every week, based on the votes and comments from others in the community. Therefore, marking this as a known-issue.

mubashir-kwanso commented 3 weeks ago

Is there any other header from which I can get the source IP address?

derekbekoe commented 3 weeks ago

Unfortunately not - this is not something we expose today.