• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Bypass CORS when on local network?

Sgraffite

Senior member
I have a Garmin Virb camera that has an API, and to use it you have to connect to the camera's WIFI access point. The access point assigns an IP address in the 192.168.0.x range, with the access point itself having the IP address 192.168.0.1.

To hit the API you make an HTTP POST request to http://192.168.0.1/virb. More details can be found here.

I decided to give it a try, so I made an html file on my local machine and put a script tag to make an ajax post to the Garmin Virb. I get this error:
Code:
XMLHttpRequest cannot load http://192.168.0.1/virb. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access

On a normal web server you could set the Access-Control-Allow-Origin as needed, but in this case I do not have any means to configure the web server as it is a camera.

Any ideas how I can communicate with the camera's API via an ajax post from a local html file?
 
Back
Top