diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 21e55530..bf9bbf1c 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc b/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc index 46eeb9e4..56928ad8 100644 Binary files a/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc and b/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc differ diff --git a/osinaweb/osichat/consumers.py b/osinaweb/osichat/consumers.py index f69fcb94..7fb12063 100644 --- a/osinaweb/osichat/consumers.py +++ b/osinaweb/osichat/consumers.py @@ -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() diff --git a/osinaweb/static/js/osichat/visitors.js b/osinaweb/static/js/osichat/visitors.js index 42b2dd12..b5b1c6e5 100644 --- a/osinaweb/static/js/osichat/visitors.js +++ b/osinaweb/static/js/osichat/visitors.js @@ -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;