From 05221490c44b89c2d9ac2e34c1f907e65e05c8a2 Mon Sep 17 00:00:00 2001 From: emile Date: Sun, 21 Jul 2024 23:29:59 +0300 Subject: [PATCH] new --- osinaweb/db.sqlite3 | Bin 1687552 -> 1687552 bytes .../__pycache__/consumers.cpython-310.pyc | Bin 4806 -> 4806 bytes osinaweb/osichat/consumers.py | 6 +++--- osinaweb/static/js/osichat/visitors.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 21e55530709a57b80d4dbdc813cb511a836309d1..bf9bbf1c3cc8bbfb0321026064da766dd3622cff 100644 GIT binary patch delta 709 zcmajbOK1~87y#g%Y<6POWGAtv$&dwesV2b`{A2^3Q#Ax+Y<+cc%t zgU0rdlhhn!k3!MAQksS0p~v)QMFek!iuO?GC5Xg>jt@k<6y}?OVgA>2I<-!x_9O&0 zdRzuKnH}4pb0y{5Rh;XX9y?Z zBE|@}HPAhyhkp_&QamNeX(iF!Kk*POfe0_*BhC`z*8a)4gqP01$Ww>^q76p2Kj4(?u3)+QS1lLOLuqdj!SX69fxp->5)n+OmuB>EyLv2OH-%yY%VVO$IbI8{QPPq z+19exL?Nk^8Vx;tyTR96_3|wtQ!(@#qAph}%lG(FNzK((jhl-rk|4>vkm3b7{NG5{ zj*7ER7tIbSc8L0D-eND~1Ojn$x`1QZD;z^jQRUz9NnR3v#iukyjEj;gisJQU!_Zr8 zEqrS8{Q}ODkDH;;40?xNSZonLK!7tJmvK?+san+(j;wj(u$XjC4*gyTZK_ZwCEL^{qzLqg9TDoo-dQK~I2}FQF3e12TU^YCvn#-ryGH1Vwr{|B=^zYc)LvO*i zxiq*L+MLuqWgSil;$Nf>M=!l+vG?Z^4)2^x-xv7^9wI!%fAH{Flz(D@CkP>4jo~jf4=t`LQt-DtKB^t$KP5Aylyqh@ojx?7_SZ@&d2TldhsrfT}KT3FUpg=&^zT9oFB zdO}U5D7Pcm?4K{)Q`|xK5s9W;J-dNo4E4^yE9M(rlV}u(z|j zO(~reWOy{C+iT25HJjnk3|?cLIt?xyq6F8QBnI&T!UH_UgHYTempCDiNl1|8aO@Ip F{V$W^tk?hm diff --git a/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc b/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc index 46eeb9e434d7c637447b49440fd94bd0b913f7fb..56928ad8152c7d4f2d279e0c045cc58cef1a0878 100644 GIT binary patch delta 34 ocmX@6dQ6ospO=@50SIQ~&rOpS+sHSUnUzV5nT>Jt24*pS0F<%^!~g&Q delta 34 ocmX@6dQ6ospO=@50SGSS%uSmkx{+@#Gb^JQ6C3m94a{Qv0HKKpc>n+a 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;