Re: [sr-dev] [kamailio/kamailio] websocket: X-Forwarded-For and X-Real-IP support (#1002)

2017-02-20 Thread Michael Ricordeau
Closed #1002. -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/1002#event-969624618___ sr-dev mailing list sr-dev@lists.sip-router.org

Re: [sr-dev] [kamailio/kamailio] websocket: X-Forwarded-For and X-Real-IP support (#1002)

2017-02-20 Thread Michael Ricordeau
@miconda I found a simple way to get the value of the X-Forwarded-For header without changing the code in the websocket module. I thought about this after reading again the comment for Juha. I'm retrieving the X-Forwarded-For header in the event:xhttp and use htable to track the conid

Re: [sr-dev] [kamailio/kamailio] websocket: X-Forwarded-For and X-Real-IP support (#1002)

2017-02-20 Thread Michael Ricordeau
tamiel commented on this pull request. > + + if ((wsc = wsconn_get(msg->rcv.proto_reserved1)) == NULL) { + LM_ERR("$ws_real_src_ip cannot retrieve websocket connection\n"); + return pv_get_null(msg, param, res); + } + + wscid = wsc->id; + +

Re: [sr-dev] [kamailio/kamailio] websocket: X-Forwarded-For and X-Real-IP support (#1002)

2017-02-20 Thread Michael Ricordeau
tamiel commented on this pull request. > + if (wsc->real_src_ip[0] == 0) { + wsconn_put(wsc); + LM_DBG("$ws_real_src_ip ws_conid %d real_src_ip is not set\n", wscid); + return pv_get_null(msg, param, res); + } + +

Re: [sr-dev] [kamailio/kamailio] websocket: X-Forwarded-For and X-Real-IP support (#1002)

2017-02-19 Thread Michael Ricordeau
@miconda This patch is working for 5.x and master branch. I have also 2 backported patches for 4.4 and 4.3. Should I create 2 pull requests? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

[sr-dev] [kamailio/kamailio] websocket: X-Forwarded-For and X-Real-IP support (#1002)

2017-02-19 Thread Michael Ricordeau
New feature to get the real source IP when kamailio websocket is behind a load balancer transmitting X-Forwarded-For and/or X-Real-IP headers: Detect HTTP headers X-Forwarded-For and X-Real-IP during the Websocket handshake. The pseudo variables $ws_real_src_ip is populated during ws_handshake()