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

Michael Ricordeau notifications at github.com
Mon Feb 20 17:50:39 CET 2017


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);
+	}
+
+	LM_DBG("$ws_real_src_ip ws_conid %d wsc->real_src_ip is %s (%d)\n", wscid, wsc->real_src_ip, (int)strlen(wsc->real_src_ip));
+	len = snprintf(buff, IP_ADDR_MAX_STR_SIZE, "%s", wsc->real_src_ip);
+	buff[len] = 0;
+
+	wsconn_put(wsc);
+
+	ip_str.s = (char *)buff;
+	ip_str.len = strlen(buff);
+	LM_DBG("$ws_real_src_ip ws_conid %d real_src_ip is %s (%d)\n", wscid, ip_str.s, ip_str.len);
+	return pv_get_strval(msg, param, res, &ip_str);

Thanks I didn't know about this function, will fix it.

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1002#discussion_r102057820
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20170220/e354cd78/attachment.html>


More information about the sr-dev mailing list