Question

I've been testing all of my cross-origin data through Node with much success. However, I recently ran into a situation where Node couldn't solve the request for data.

I'm using the getImageData() function, which throws the cross-origin problem. On other cross-origin problems, Node can successfully handle the requests, but this function seems to give it trouble.

Also, if I package it up with node-webkit and run it stand-alone, it works great. I'm sure there is an explanation, but I cannot find it. Why would node-webkit work, but running a Node.js server not?

Without pouring code all over this page, let me try to explain what I'm doing. I have an Axis Camera that I'm getting data from. It's Motion JPEG, and it get stored in the img tag that I've got ID'd. The data is coming from http://ip, etc, etc.

I think the problem is that the getImageData() function is requesting from the img tag ID rather than somewhere external, which would in-turn throw the cross-origin flag.

Am I correct? How can I solve this?

Also, does anyone know of a good way to test node-webkit apps without actually packaging them? Essentially, a node-webkit simulator?

Was it helpful?

Solution

I have solved the problem by adding this to the package.json:

"chromium-args": "--disable-web-security",

Try it!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top