Js Webapps, cppagent and CORS #337
-
Hi all, Has anyone worked with cppagent in the context of a js web app? Someone has to have made a web app for mtconnect? How can we work with CORS? What is the default CORS policy in cppagent? Is it configurable? |
Beta Was this translation helpful? Give feedback.
Answered by
robot-ranger
Oct 12, 2023
Replies: 3 comments 1 reply
-
The demo is a web app example that animates a digital twin. CORS policies are configurable by adding custom HTTP headers. I’ll check there docs. (Sent from mobile)On Oct 11, 2023, at 01:21, robot-ranger ***@***.***> wrote:
Hi all,
Has anyone worked with cppagent in the context of a js web app? Someone has to have made a web app for mtconnect?
How can we work with CORS? What is the default CORS policy in cppagent? Is it configurable?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Thanks, I’ll add this to the documentation. - WOn Oct 12, 2023, at 17:43, robot-ranger ***@***.***> wrote:
yea, my developer figured out the Http headers by reverse engineering the parsing code. we couldnt find it documented anywhere.
if anyone else stumbles on this in the future, we added the following to agent.cfg to allow all cross-origin:
HttpHeaders {
Access-Control-Allow-Origin = *
Access-Control-Allow-Methods = GET
Access-Control-Allow-Headers = Content-Type
}
I believe you could replace the * with a list of origins to specify whitelisted cross-origins
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Added to the README in the 2.2.0.10 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yea, my developer figured out the Http headers by reverse engineering the parsing code. we couldnt find it documented anywhere.
if anyone else stumbles on this in the future, we added the following to agent.cfg to allow all cross-origin:
I believe you could replace the * with a list of origins to specify whitelisted cross-origins