mnet: how should I run the example ?

Monkey Targets Forums/HTML5/mnet: how should I run the example ?

semar(Posted 2012) [#1]
All,

I have the latest monkey MonkeyPro58.

I have downloaded the mnet library version 1.03 and installed the mnet directory inside the monkey module directory.

Then I load the mnet example, and I build it using HTML5 as target.

I then open with Firefox the file created:
file:///C:/monkey/MonkeyPro45c/mnet-v1.03/examples/httpget.build/html5/MonkeyGame.html

I only get:
Result:undefined.

What's wrong here ?

Regards,
Sergio.


semar(Posted 2012) [#2]
Ah, I see, the html5 application can do an http request only in the same domain where it is installed.

If I watch with FireBug what the html5 application does when it runs in my local Firefox browser, it seems that it does perform an http GET to outside (google.com in the example provided), but there's no response back.

Or is that GET a fake ?

Any thoughts ?

Sergio.


Xaron(Posted 2012) [#3]
Yep that's mainly the problems that you usually can't do cross domain access. Somewhere here in the forum was a solution for this which I want to integrate into MNet as well...

I think that might be the fix...

http://monkeycoder.co.nz/Community/posts.php?topic=2895


semar(Posted 2012) [#4]
Hi Xaron,

to be honest, I think that the 'solution' posted in the link can not circumnavigate the html5 cross domain access limitation, rather it only avoids that the string "undefined" will returned from the function.

Correct me if I'm wrong.

Sergio.


Xaron(Posted 2012) [#5]
Lol yes indeed. My apologies, I'm a bit tired atm.

But somewhere here was a solution for this, I'm pretty sure...


golomp(Posted 2012) [#6]
Hi Xaron,

Splendid work you do. I tested the html connexion,
it works fine...


Fryman(Posted 2012) [#7]
Wasn't the solution to set your server up to allow xss or is this a browser only issue?


Rushino(Posted 2012) [#8]
If you use ASP.NET WebAPI.. the easy solution is to integrate CORS handlers from the headers. This enable to test locally.

http://blogs.msdn.com/b/carlosfigueira/archive/2012/02/20/implementing-cors-support-in-asp-net-web-apis.aspx


c.k.(Posted 2012) [#9]
I use a curl_exec() in a local php file to do my x-domain requests (which is how Scoreoid does it).


Rushino(Posted 2012) [#10]
Yeah... php seem easier to handle with that.