I am encountering CORS errors. My Milestone server is on a machine and I am trying to access it from another server. I have read the documentation and modified the file VideoOs.MobileServer.Service.exe.config located at : C:/Program Files/Milestone/Xprotect Mobile Server.
I have modified the following line to use a wildcard for the Access-Control-Allow-Origin key.
I restarted the services multiple time and I am still encountering this error. Is there anything I am missing? This is on Essential+ 2019R2.
Thanks!
Does IIS’s HTTP Headers take precedence over the ones defined in this file? I was able to set them manually in IIS’s HTTP Response Headers. However, upon refreshing the page I now get a new error, XProtectMobile/Communication returns a 404.
If you have not used or seen this?.. https://developer.milestonesys.com/s/article/XProtect-Mobile-Server-app-on-different-server-CORS
Let me know if this does not help, does not lead you to a solution..
Hi Bo,
Thanks for the quick answer. I have followed the steps under point 2) included in this article. I am still unable to connect to the server and keep getting CORS error in the console in both Chrome and Firefox. I am really wondering what I am doing wrong here..
Here’s the content of my HttpHeaders tag in VideoOs.MobileServer.Service.exe.config file. See anything missing?
If I restart the Milestone Mobile Server service, I encounter the same error in the console. Access to XMLHttpRequest at ‘http://myMilestoneServer/XProtectMobile/Communication’ from origin ‘http://myMachine’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
Like I mentionned, the only way I am able to see this message change is if I specify these headers in the IIS’s HttpHeaders module and not in the config file. Unfortunately, when adding these iun IIS’s HttpHeader module, I encounter a 404 error when trying to access XProtectMobile/Communication.
Hey, I just figured out what I was doing wrong. I forgot I needed to connect to port 8081. Sorry, that was my bad. Changing the VideoOs.MobileServer.Service.exe.config and connecting to the server using port 8081 works for me.