emile 10 months ago
parent be0140c2c3
commit 05221490c4

Binary file not shown.

@ -12,11 +12,11 @@ class OsitcomVisitor(WebsocketConsumer):
self.accept()
ip_address = self.scope.get('headers', {}).get('x-forwarded-for', None)
if ip_address:
# Extract the actual IP address if there are multiple addresses
self.visitor_ip = ip_address.split(',')[0].strip()
else:
self.visitor_ip = self.scope.get('client', [None])[0]
# Fallback to the standard remote address
self.visitor_ip = self.scope.get('client', [None])[0]
if self.visitor_ip:
response = requests.get(f'http://ipinfo.io/{self.visitor_ip}/json')
data = response.json()

@ -1,6 +1,6 @@
const visitors_ws_scheme = window.location.protocol === "https:" ? "wss" : "ws";
const my_domain = "osina.ositcom.com";
const my_domain = "192.168.1.111:5000";
const session_id = document.getElementById('session_id').textContent.trim();
const current_url = document.getElementById('current_url').textContent.trim();
const referrer = document.referrer;

Loading…
Cancel
Save