[How to] Cross domain GET/POST during develop

Discussion and feedback on Construct 2

Post » Tue Aug 28, 2012 4:45 pm

Hi

Nothing found in the forum. I apologize if I repeat the post.

If you have to send HTTP requests (GET / POST) during development (to send highscores for example) you will see that you can not, because the browser detects that localhost and the domain to which you send or request information (mydomain.com) are different domains.

In order to make cross-domain requests installs Firefox and the extension Force CORS 1.3. Press Ctrl+/ to view the extensions toolbar and you'll see the text cors, if you click will turn red and capitalization: from that moment you may do requests POST / GET from localhost to your server and save a lot of time.

Note 1: Use the extension at your own risk. Do not surf the internet with CORS enabled.

Note 2: Sorry for my English. josuanbn2012-08-28 16:46:48
B
7
Posts: 4
Reputation: 913

Post » Tue Aug 28, 2012 8:24 pm

In the AJAX manual entry there's a full section about "Making AJAX requests cross-domain or in preview". It's possibly safer and less browser dependent than installing extensions.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Tue Aug 28, 2012 11:30 pm

Hi

I've read the manual but that solution, I understand that compromises the security of the server.

With the Firefox extension I can only compromise the security of my browser when specifically active (if you close Firefox is automatically disabled)

Best regards

Josua
B
7
Posts: 4
Reputation: 913


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests