Question:
Hi, I’m extremely new to Wix/web development. I have a webpage that compares the distance between two locations by referencing Google’s Geocode API.
I have this call happening on the backend (as i understand, this is preferred/more secure). The problem is, when I set the API key’s Application restrictions to “ip Address”, i do not know Wix’s backend ip address.
Does this approach even make sense.
If so, why does there seem to be no documentation on this process and does anyone have a solution (e.g. Wix static ip address range).
Product:
Wix Editor
What are you trying to achieve:
Use Google Geocode API
What have you already tried:
I have created a dedicated Google Maps API key for my backend code.
I am storing this API key securely using Wix Secrets Manager.
I have verified that my Velo code is correctly calling the Geocoding API (I can see successful requests in the Google Cloud Console when the key is unrestricted).
I have attempted to log the response headers from the Geocoding API (using console.log(response.headers)) to identify the Wix server IP addresses, but the necessary headers (like X-Forwarded-For, Via, X-Real-IP) are not present in the API response. This is expected behavior for the Geocoding API.
If there is a solution, it might be, as mentioned in this topic, to use a proxy server as an intermediary to make it appear as if the IP is fixed. I also encountered this issue when I was practicing implementing a payment service and was required to have a fixed IP. My conclusion at that time was similar. In the end, I gave up on making it work.
Well, since you’re trying to do something complex, it’s not surprising that things aren’t going smoothly. Besides, it’s not like a fixed IP is absolutely required to use the Geocode API, right?
Correct (the functionality works without getting the proxy involved), I’m just trying to implement SOME form of Application restrictions on the API while it’s being called from the backend. I’m open to any and all suggestions at this point lol