Getting IP of the client

I am interested in getting the IP of the client connected to the Panel application. From this thread I can see that it’s possible to get the IP via third-party:

However, in my case I’m interested in using information on the private/local IP address of the client (that I expect is not accessible via third-party). To give the a specific example, suppose I launch a dummy server using:

panel serve --allow-websocket-origin=“*” test_app.py

Then if I access the application from another computer on the same network, I can see the application. If instead, I launch the following:

panel serve test_app.py

Then, when I access the application from another computer, the application doesn’t show and instead I see the following line in the terminal:

2024-10-27 07:00:14,078 Refusing websocket connection from Origin ‘http://MY_IP_REMOVED:5006’; use --allow-websocket-origin=MY_IP_REMOVED:5006 or set BOKEH_ALLOW_WS_ORIGIN=MY_IP_REMOVED:5006 to permit this; currently we allow origins {‘localhost:5006’}
2024-10-27 07:00:14,078 403 GET /test_app/ws (ANOTHER_IP) 1.21ms

Note that the terminal shows the correct IP (replaced with ANOTHER_IP in the output above), so I assume it’s possible to get that value programmatically.

There is a relevant thread on GitHub for Bokeh (bokeh server: get client IP adress without embedding in Django/Flask/..[FEATURE] · Issue #9252 · bokeh/bokeh · GitHub), however from further googling I was not able to understand how to access the client IP via bokeh/panel.