... ES instance running on WSL...
I'm on Windows only. And what is an "ES instance" and "WSL" ?
rgr
Ah ok.
ES Instance: Simply an instance of Elasticsearch - meaning "one running version of it somewhere"
WSL: Windows Subsystem for Linux - Microsoft integrated a linux kernel into Windows some time ago, running as very lightweight virtual machine under Windows. I do all my dayjob coding now in there, as the stuff I need runs like 99% smoothly and I can properly develop on Linux without having to dual-boot, a separate laptop or other shenanigans. Additional benefit, due to the forwarding mentioned in other posts here, my Browser on Windows can access the server running on this Linux as localhost. So if I am developing a webapp, I use VSCode's remote function to write the code, execute the command line of linux to run it, and my windows browser to access it. The Linux doesn't need any GUI facilities this way - best of both worlds imo.
For my problem in this thread this means - the architecture is like this:
Windows -> Developing Lazarus apps for fun, to learn a new language and quick GUI stuff
Linux inside Windows -> Dayjob coding, machine learning, SysAdmin automation etc
Which in turn means -> ES is hosted inside the Linux VM, since I need it for the dayjob - that enables convenience using the elasticsearch package with Python in my linux dev setup, as the default is "localhost", meaning when I write my data into the "production server", I simply input it's IP and off we go, while I can test, delete and adjust my logic on my local ES instance - just to be sure I don't accidentally change/delete something important. At the same time, I can easily use a chrome extension on windows to do simple ES queries to check if stuff gets done right - by querying localhost as well.
So what I tried to do for the original question was creating a unit for elasticsearch access - similarly as I would create a python module, to conveniently just call a couple functions to interact and write/read data. The problem seems to arise in the way Windows handles that port forwarding - as said, Chrome, Python, Curl etc all get properly forwarded to the Linux VM underneath, the FPC app does not - but
only in the case of Elasticsearch. Other servers I run under my linux can be accessed as intended.
Unfortunately ES isn't supported on WSL (meaning - it runs, I've been working that way for over 2 years xD, but they don't give official support for it). So if you ask th eES guys a question - the answer is "it's not supported, sorry". The interesting part is merely, that it just concern that forwarding constellation - as mentioned, connecting to the ES Instance via the Linux VM's URL does work (with ES in an "expanded development" mode).
I hope that clears it all up a bit :-)