Yes summary:
On milestone server machine, the edit to allow cors on remote machine has been made.
Functionality verified ok through web video sample app file.
When document.location is file app functions great.
When document.location is http (ip:port of machine configured ok for cors on milestone server machine), then a cors request error is returned.
Current activity includes troubleshooting why this is, looking for solutions please and/or recommendations regarding what to check next.
Thomas
Thanks Thomas,
I’ll repeat part of the previous answer:
If you have troubles loading SDK from the Mobile server, you can host it at the place where you host your sample/page.
I’ve tested CORS setting few days ago, and they worked fine (I was able to make Sample running/hosted on one Mobile server to connect to another Mobile server).
So please check your configuration.
I do never run samples from file - they are always hosted, usually from one of another Mobile server.
(Making sample to run from file doesn’t bring me any value - it is not usable for any integration - with small exceptions of course (JSONP for example) )
When I want to make Sample 1 hosted on MoS 1 to connect to MoS 2, usually I have to make 2 things:
- on MoS 1 disable Content Security policy
- on MoS 2 enable CORS for address of the MOS 1
Please be sure that address added into CORS settings of MOS 2 is exactly the same with those from which the page is loaded from MOS 1.
For example filling IP:Port in CORS settings, but loading page from machine name or localhost WON’T work at all.
Also ensure that you have entered the full address in the CORS setting of MOS 2, together with protocol. For example: “http://foo.bar.org” or “https://:”.
What you can check further is to try with asterisks (“*”) - enable all.
As well as to check security setting on the system that is hosting your page.
Update,
After the cors edit to the config file on the milestone server machine to allow the remote server communication, an interpretation was that verifying that the sample video web app connected ok was confirmation that cors request was ok.
So to check, I tested if the same sample app also launched ok from file on another vm, which it did. Which means the cors request has not been verified as functional on the aim vm functioning as the mobile server.
I was sitting right there when the edit was made to the file with the machine name. Currently waiting until tomorrow for the Milestone admin to be available.
Disable Content Security policy returns same error unfortunately at this time.
Best solution I got at the moment is to add the ip and also an ip: with specific port. Then check again. Ideally was aiming not to specify a specific port as more than one specific ports will be needed.
Thomas
Port have to be specified for sure.
Please bear in mind that “http://:” and “http://:” are totally different end points.
If you miss the port it will be guessed and defaulted by the browser to 80 or 443 depending on the protocol.
If you plan to access the MoS from 2 different addresses (eg ports) it could be tricky.
According to MDN (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin) only single entry is supported or global wildcard (star symbol “*”).
Much appreciated, looking forward to tomorrow to apply the solution.
The single port is a bit concerning as an aim of integrating into a solution relies on producing a unique port for each session login at the moment. One bridge, step, at a time though.
Thomas
In preparation of potential solutions to enable all ports from an ip, this was a random find on the internet,
SetEnvIf Origin “http(s)?://(.+\.)?mywebsite\.com(:\d{1,5})?$” CORS=$0
Header set Access-Control-Allow-Origin “%{CORS}e” env=CORS
Header merge Vary “Origin”
Is this cors format something that may enabled many ports from ip in the circumstance please?
Thomas
The setting in the Mobile Server is transmitted “as is” in a “Access-Control-Allow-Origin” http header value in the http response message.
Nothing like this is going to work.
Understood, aiming to edit per the one port definition soon.
Wondering if a proxy is a solution, where multiple apps are accessible concurrently from a specific ip:port, at the moment I’m reading into specifics regarding that. Unfortunately I’m not a web developer yet however I would assume there definitely is a solution where multiple concurrent apps are accessible in the circumstance of one ip:port defined for dedicated web server app machine.
Interested to learn about the structure of a typical solution where cors to one ip :port supports multiple concurrent app sessions please.
Thomas
Update, new obstacle,
Milestone server rev is 11.1a. Must have been overlooked on the first round of edits.
I think I may have misinterpreted the year on the client view for the server revision date.
Is upgrading from 11.1a to at least 11.3a a significant event please?
The cors edit to ip:port was not made due to finding that current version is <11.3a unfortunately.
Thomas
It shouldn’t be.
Update to 11.3 and try again, please !
Update,
Summary of long discussion with network Milestone admin included a description that upgrading the server version is difficulty level = max.
I explained all the value added with the opportunities the update enables regarding the bridge through web based integration projects.
Best I got at the moment is to read into more specifics about what the update involves and keep being involved and checking back in.
I appreciate the info gain up to this point regarding the dedicated mobile server machine connection specifics Petar, ty.
Thomas