# Webrtc client IP addresses and reverse proxy

**URL:** <https://community.asterisk.org/t/webrtc-client-ip-addresses-and-reverse-proxy/94461>\
**Category:** Asterisk WebRTC\
**Created:** [October 21, 2022, 11:38am UTC](https://community.asterisk.org/t/webrtc-client-ip-addresses-and-reverse-proxy/94461 "2022-10-21T11:38:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vieri](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/vieri/32/6580_2.png) [@Vieri](https://community.asterisk.org/u/Vieri)\
**Post date:** [October 21, 2022, 11:38am UTC](https://community.asterisk.org/t/webrtc-client-ip-addresses-and-reverse-proxy/94461/1 "2022-10-21T11:38:42Z")

</div>

Hi,

According to [ASTERISK-30272: webrtc client IP addresses behind reverse proxy](https://issues.asterisk.org/jira/browse/ASTERISK-30272) this feature request should be discussed here.

Briefly:

asterisk -rx “pjsip show endpoints” | grep Contact

shows 127.0.0.1 for webrtc clients connecting via reverse proxy.

Could Asterisk show X-Forwarded-For only for “trusted” proxies?

This matter has already been brought up here:

> [@Websocket for WebRTC behind Reverse Proxy](https://community.asterisk.org/t/websocket-for-webrtc-behind-reverse-proxy/88762):
>
> Im trying to run the http server of Asterisk behind a reverse proxy (running on the same device as Asterisk itself). All is working ok, except i always get 127.0.0.1 as the host for the devices connected using websockets. This a common problem with reverse proxies, because after passing it, the new source ip is no longer the original one but the one of the reverse proxy, but normally this can be solved by using the header ’ X-Forwarded-For’ or ’ X-Real-IP’ in the http request and putting the ori…

I don’t have a patch proposal, but wouldn’t it be useful?

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [October 21, 2022, 11:50am UTC](https://community.asterisk.org/t/webrtc-client-ip-addresses-and-reverse-proxy/94461/2 "2022-10-21T11:50:00Z")

</div>

I don’t think anyone can disagree with it being useful. Someone ultimately has to do the work, though.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [November 20, 2022, 11:50am UTC](https://community.asterisk.org/t/webrtc-client-ip-addresses-and-reverse-proxy/94461/3 "2022-11-20T11:50:03Z")

</div>

Closed on November 20, 2022, 11:50am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
