Hey! JHPJHP
Thanks! I will wait for more options, but the php seems a good option.
About the .htaccess, I don't know, but... maybe the redirection exposes te apikey on the client browser url bar?
Your original question included a QUERY_STRING for the API Key.
It didn't make much sense at the time, but I guess it could have been an enclosed environment.
Would probably be helpful to others if you provide additional details:
• What format is the is the image expected, or is just the image name required as your previous post suggests?
• Otherwise, the server is probably expecting either the full URL to the image or the image converted into Base64.
• Redirecting from a server you control, then a POST request using the Fetch API is an obvious choice.
• Most (API) servers have specific requirements (i.e. expecting JSON).
• I'm assuming you'll be receiving a response, what's the format of the response?
I probably have tunnel-vision; wait for a PB answer:
As I just finished an App that served both an image URL and Base64 image string to a server that required an API Key.
• The API Key was secured, the POST data was JSON encoded, and the response imaged data was also JSON encoded.
Anyways, good luck.
Last edited by JHPJHP on Thu Feb 20, 2025 5:11 pm, edited 2 times in total.
If you're not investing in yourself, you're falling behind.
My example was only a general one (not mine), but if you ask me for more specific...:
For my current project, I need to consume tile maps of this site: https://protomaps.com/api so... the only thing I want to hide, is the apikey for obvious reasons.
In resumen, The apikey must be only in my server where no one can see it.
atomic webserver does tls terminating reverse proxy on windows but only with pb 6.12
so you can run multiple domains on the same machine or other machines behind the nat.
It doesn't work properly on linux though which might have been an issue with the tls lib version or build
but you can easily fetch recourses with atomic webserver too with https requests
idle wrote: Thu Feb 20, 2025 9:29 pm
but you can easily fetch recourses with atomic webserver too with https requests
I don't mind if the server needs Windows for this, in fact my first choice was AtomicServer, but I haven't enough skills to do what I need transparently.
I've got it working in atomicwebserver but I can handle it better by changing how URI handlers are implemented
so you can set them by depth so domain/tiles/ will catch any children under it like domain/tiles/z/x/y
it makes more sense plus it's easy to cache them to disk to reduce the overhead of fetching them again.